offsite 0.0.53 → 0.0.55
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.
- package/apps/client/dist/assets/TextWrapIcon-CaHR7d2a.js +57 -0
- package/apps/client/dist/assets/XIcon-C8QiXos4.js +1 -0
- package/apps/client/dist/assets/appendItems-BzU1_nhw.js +9 -0
- package/apps/client/dist/assets/button-CWFREsRn.js +1 -0
- package/apps/client/dist/assets/ccount-D7kz22QW.js +1 -0
- package/apps/client/dist/assets/{getFiletypeFromFileName-BCvBvB1y.js → context-menu-CniNpkSW.js} +26 -83
- package/apps/client/dist/assets/{core-CFb9AGbX.js → core-yhRGiujn.js} +1 -1
- package/apps/client/dist/assets/diff-panel-DfyRZtVh.js +408 -0
- package/apps/client/dist/assets/dist-C_Y10kCd.js +1 -0
- package/apps/client/dist/assets/dist-D58YXc_P.js +2 -0
- package/apps/client/dist/assets/dist-D9LSGRim.js +1 -0
- package/apps/client/dist/assets/{dist-DSkulxAq.js → dist-TdUDcI9m.js} +3 -3
- package/apps/client/dist/assets/editor-dialog-Bc1Gpfll.js +52 -0
- package/apps/client/dist/assets/es-YYQGP5MR.js +2 -0
- package/apps/client/dist/assets/getFiletypeFromFileName-DGoZTiUS.js +1 -0
- package/apps/client/dist/assets/{highlights-GmPC35Dk.js → highlights-ClFpvuAt.js} +1 -1
- package/apps/client/dist/assets/{image-viewer-UqY5jZoH.js → image-viewer-BPClqXmZ.js} +1 -1
- package/apps/client/dist/assets/index-BwVrIQyk.js +21 -0
- package/apps/client/dist/assets/index-DkhFb5Mr.css +2 -0
- package/apps/client/dist/assets/lib-m_q9jTTN.js +1 -0
- package/apps/client/dist/assets/libesm-Dyf3eB1R.js +13 -0
- package/apps/client/dist/assets/{preview-dialog-BLxM80N3.js → preview-dialog-DvyH_XYP.js} +3 -3
- package/apps/client/dist/assets/{renderTokenLines-DSu8n2ID.js → renderTokenLines-CZITQnBN.js} +2 -2
- package/apps/client/dist/assets/{shiki-S2UQ6acJ.js → shiki-BoAJalUP.js} +1 -1
- package/apps/client/dist/assets/{stream-tokenizer-DZPEnOzC.js → stream-tokenizer-bYvWJIhm.js} +1 -1
- package/apps/client/dist/assets/themes-P0s7avrn.js +2 -0
- package/apps/client/dist/assets/tooltip-CVA2QYzo.js +1 -0
- package/apps/client/dist/assets/{video-viewer-DymHqMFS.js → video-viewer-BATGlwTk.js} +1 -1
- package/apps/client/dist/assets/zoomable-image-DkYN4OSU.js +1 -0
- package/apps/client/dist/assets/{zoomable-image-DRthozgI.js → zoomable-image-E-lZC3nM.js} +2 -2
- package/apps/client/dist/index.html +11 -13
- package/apps/client/dist/sw.js +1 -1
- package/apps/server/dist/main.mjs +150 -49
- package/apps/server/dist/main.mjs.map +1 -1
- package/package.json +1 -1
- package/apps/client/dist/assets/appendItems-C8N70W-m.js +0 -9
- package/apps/client/dist/assets/button-CdLSr6OC.js +0 -1
- package/apps/client/dist/assets/dist-DRetoCkD.js +0 -1
- package/apps/client/dist/assets/dist-DygZhkc7.js +0 -2
- package/apps/client/dist/assets/editor-dialog-D5uma-Ri.js +0 -52
- package/apps/client/dist/assets/index-4D8bvVNO.css +0 -2
- package/apps/client/dist/assets/index-B9iE7Ipt.js +0 -440
- package/apps/client/dist/assets/lib-CVj84X52.js +0 -1
- package/apps/client/dist/assets/themes-DcJzud8j.js +0 -2
- package/apps/client/dist/assets/tooltip-wzGTbg8k.js +0 -1
- package/apps/client/dist/assets/zoomable-image-CkjasN2N.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/langs-DdlLhtBb.js","assets/langs-DssLtjmH.js","assets/preload-helper-BLdHbfdN.js","assets/engine-oniguruma-Dl5gvpE_.js","assets/engine-oniguruma-BMl9YtsA.js","assets/rolldown-runtime-COiEfhsA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,n as t,r as n,t as r}from"./constants-CmGPilXJ.js";import{d as i,f as a}from"./renderTokenLines-DSu8n2ID.js";import{t as o}from"./preload-helper-BLdHbfdN.js";import{n as s,t as c}from"./stream-tokenizer-DZPEnOzC.js";import{G as l,U as u,c as d,s as f}from"./dist-DSkulxAq.js";import{t as p}from"./appendItems-C8N70W-m.js";function m(e,t){for(let i of Array.isArray(e)?e:[e]){let e=n.get(i.name);e??(e=i,n.set(i.name,e)),t.attachLanguages([e]),r.add(e.name)}}async function h(r){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:a())throw Error(`resolveLanguage("${r}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let i=e.get(r);if(i!=null)return i;let s=(async()=>{let e=t.get(r);if(e==null){let{bundledLanguages:t}=await o(async()=>{let{bundledLanguages:e}=await import(`./langs-DdlLhtBb.js`);return{bundledLanguages:e}},__vite__mapDeps([0,1,2]));Object.prototype.hasOwnProperty.call(t,r)&&(e=t[r])}if(e==null)throw Error(`resolveLanguage: "${r}" not found in bundled or custom languages`);let{default:i}=await e(),a={name:r,data:i};return n.has(r)||n.set(r,a),a})();e.set(r,s);try{return await s}finally{e.get(r)===s&&e.delete(r)}}function g(e){return n.get(e)??h(e)}async function _(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=g(r)??h(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function v(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var y=0,b=0,x=class{backend;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=[l];#d=[];#f=0;#p=[];#m=-1;#h=!0;#g=!1;#_=0;#v=++b;#y=-1;#b=-1;#x;#S=0;#C=[];#w=!1;#T=v(async e=>{if(this.#l)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#i.lineCount);if(this.#t==null&&!C(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#l)return;this.#t=this.#e.getLanguage(this.#i.languageId)}this.#D(),this.#N(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#v&&typeof r==`number`&&r===this.#_&&(this.#y>=0?this.#z(r):this.#B(r))};getStringCommentRegexpRangesInLine(e){if(!this.#s||e<0||e>=this.#i.lineCount||(this.#O(),this.#t==null))return null;if(this.#C[e]===void 0){this.#R(e);let t=this.#u[e]??l,n=this.#P(e,t);this.#u[e+1]=n.state}return this.#C[e]??null}constructor(e,t,n){this.backend=n,this.#e=e,this.#i=t.textDocument,this.#n=t.theme,this.#r=[],this.#a=t.tokenizeMaxLineLength??1e3,this.#o=t.onDeferTokenize,this.#s=t.matchBrackets!==!1,this.#c=t.__debug??!1,this.#O(),this.#D()}setTheme(e){this.#n!==e&&(this.#n=e,this.#D(),this.stopBackgroundTokenize(),this.#u=[l],this.#d=[],this.#f=0,this.#p=[],this.#t!=null&&this.#i.lineCount>0&&this.#M(0))}#D(){if(this.#n===``)return;this.backend?.getTheme(this.#n);let{colorMap:e}=this.#e.setTheme(this.#n);this.#r=e}dispose(){this.#l=!0,this.stopBackgroundTokenize(),this.#A()}tokenize(e,t,n=!1){if(this.#O(),this.#D(),this.#t==null&&!C(this.#i.languageId))throw Error(`Grammar for language "${this.#i.languageId}" not loaded`);let{lineCount:r}=this.#i,{startingLine:i=0,totalLines:a=1/0}=t??{},o=a===1/0?r:Math.min(i+a,r),s=e.startLine,c=Math.max(i,s),u=t!=null&&a!==1/0&&e.lineDelta>0&&s<o&&e.endLine>=o,d=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0);this.#s&&!d&&(this.#C.length=Math.min(this.#C.length,e.startLine));let f=n&&e.lineDelta!==0&&s>=i,p=d||t==null||s>=c,m=e.changedLineRanges??[[s,e.endLine]];this.#d=[],this.#f=0,this.#p=[];let h=-1;if(s<c)for(let[e,t]of m)e<c&&(h=Math.max(h,Math.min(t,c-1)));let g=h>=s&&(d||e.lineDelta<0);d?this.#R(s):(this.#I(e),(t==null||s>=c)&&this.#R(c));let _=0,v=m[_][1],y,b=0,x=d?m[_][0]:c,S=!1,w=new Map,T=g?new Map:void 0;if(T!=null&&!d){let e=Math.min(h+1,c,o);if(e>s){this.#R(e);let t=s,n=this.#u[t]??l;for(;t<e;t++){let e=this.#P(t,n);n=e.state,T.set(t,e.resolvedTokens)}this.#u[e]=n}}let E=this.#u[x]??l;for(;x<o;){let e=d?this.#u[x+1]:f?this.#L(x+1):void 0;p&&(this.#u[x]=E);let{resolvedTokens:t,state:n}=this.#P(x,E);if(E=n,x>=c?w.set(x,t):T?.set(x,t),p&&(this.#u[x+1]=E),S=x>=v&&(d||f)&&e!=null&&E.equals(e),S){_++;let e=m[_];if(e==null)break;if(e[0]>=o){y=e[0],b=_;break}let t=this.#u[e[0]];if(f)for(let n=x+2;n<=e[0]&&(t=this.#L(n),t!=null);n++)this.#u[n]=t;t==null?(v=e[1],x++):(x=e[0],E=t,v=e[1]),S=!1}else x++}if(p&&(x<o?this.#u[x+1]=E:this.#u[x]=E),S&&f&&y==null){for(let e=x+2;e<=r;e++){let t=this.#L(e);if(t==null)break;this.#u[e]=t}this.#d=[],this.#f=0,this.#p=[]}if(T!=null&&T.size>0&&this.#o(T),y!=null)this.#s&&d&&(this.#C.length=Math.min(this.#C.length,y)),this.#M(y,m,b);else if(!S&&x<r){let e=u&&s>=c?o:s<c&&!d?s:x;this.#s&&d&&(this.#C.length=Math.min(this.#C.length,e)),this.#M(e,m,_)}return w}prebuildStateStack(e){this.#O(),this.#T(e)}stopBackgroundTokenize(){this.#b=-1,this.#h||(this.#h=!0,this.#g=!1,this.#m=-1,this.#y=-1,this.#x=void 0,this.#S=0,this.#d=[],this.#f=0,this.#p=[],this.#A())}pauseBackgroundTokenize(){this.#h||this.#g||(this.#c&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#_}),this.#g=!0)}resumeBackgroundTokenize(){this.#h||!this.#g||this.#t==null||this.#m<0||(this.#c&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#_}),this.#g=!1,this.#j(this.#_))}#O(){this.#t==null&&!C(this.#i.languageId)&&this.#e.getLoadedLanguages().includes(this.#i.languageId)&&(this.#t=this.#e.getLanguage(this.#i.languageId))}#k(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#A(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#j(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#v,jobId:e})}#M(e,t,n=0){if(C(this.#i.languageId))return;let r=++this.#_;this.#c&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#h=!1,this.#g=!1,this.#m=e,this.#y>=0&&(this.#b=Math.max(this.#b,this.#y)),this.#y=-1,this.#x=t,this.#S=n,this.#k(),this.#j(r)}#N(e){if(this.#t==null||this.#u.length>e)return;if(!this.#h){this.#y>=0?this.#y=Math.max(this.#y,e):this.#b=Math.max(this.#b,e);return}let t=++this.#_;this.#h=!1,this.#g=!1,this.#m=this.#u.length-1,this.#y=e,this.#b=-1,this.#x=void 0,this.#S=0,this.#k(),this.#j(t)}#P(e,t){let n=this.#i.getLineText(e);if(n.length>=this.#a)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t==null||n===``||n.trim()===``)return this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=S(this.#t,this.#r,n,t,y,this.#s);return this.#F(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#F(e,t){this.#s&&(this.#C[e]=t)}#I(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#u.length-n?(this.#d=this.#u,this.#f=0,this.#u=this.#u.slice(0,n)):(this.#f=n,this.#d=this.#u.slice(n),this.#u.length=Math.min(this.#u.length,n)),this.#p=t}#L(e){let t=e;for(let n=this.#p.length-1;n>=0;n--){let[r,i,a]=this.#p[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#u[e]}}return this.#d[t-this.#f]??this.#u[e]}#R(e,t){let n=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#u.length>n||this.#t==null)return!0;let r=t==null?0:performance.now(),i=this.#u.length-1,a=this.#u[i]??l;for(;i<n;){this.#u[i]=a;let e=this.#i.getLineText(i);if(e.length<this.#a&&e!==``&&e.trim()!==``){let t=S(this.#t,this.#r,e,a,y,this.#s,!1);this.#F(i,t.bracketIgnoredRanges),a=t.ruleStack}else this.#F(i,null);if(i++,this.#u[i]=a,t!=null&&performance.now()-r>t)break}return i>=n}#z(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=this.#R(this.#y,1);this.#h||this.#g||e!==this.#_||(t?this.stopBackgroundTokenize():(this.#m=this.#u.length-1,this.#j(e)))}#B(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=performance.now(),n=new Map,r=this.#i.lineCount,i=this.#x,a=this.#m,o=this.#u[a]??l,s=!1,c=this.#S,u=i?.[c]?.[1];for(;a<r;){this.#u[a]=o;let e=u==null?void 0:this.#L(a+1),r=this.#P(a,o);if(n.set(a,r.resolvedTokens),o=r.state,this.#u[a+1]=o,s=u!=null&&a>=u&&e!=null&&o.equals(e),a++,s){c++;let e=i?.[c];if(e==null)break;if(u=e[1],this.#u[e[0]]==null)s=!1;else{a=e[0],o=this.#u[a]??o,s=!1;continue}}if(performance.now()-t>1)break}if(this.#o(n),!(this.#h||this.#g||e!==this.#_)){if(s||a>=r){let e=this.#b;this.stopBackgroundTokenize(),e>=0&&this.#N(e)}else this.#m=a,this.#S=c,this.#j(e)}}};function S(e,t,n,r,i,a=!0,o=!0){let s=e.tokenizeLine2(n,r,i);s.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let c=s.tokens,l=c.length/2,d=[],f=[];if(!o&&!a)return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let e=0;e<l;e++){let r=c[2*e],i=e+1<l?c[2*e+2]:n.length;if(r===i)continue;let s=c[2*e+1];if(o){let e=u.getForeground(s);d.push([r,t[e],n.slice(r,i)])}a&&u.getTokenType(s)>0&&f.push([r,i])}return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function C(e){return e===`text`||e===`ansi`}var w=class e extends c{highlighter;options;#e=``;#t;constructor(e,t){super(),this.highlighter=e,this.options=t}tokenizeChunk(e,t){let n=(this.#e+e).split(/(\r\n|\r|\n)/),r=[];for(let e=0;e<n.length;e+=2){let i=n[e],a=this.highlighter.codeToTokens(i,{...this.options,grammarState:this.#t}),o=a.tokens[0].map(e=>({...e,offset:e.offset+this.stableOffset}));e+1<n.length?(p(t,o),this.pushLineBreak(t,i.length,n[e+1]),this.#t=a.grammarState):(r=o,this.#e=i)}return{unstable:r,tailLength:this.#e.length}}clone(){this.assertActive();let t=new e(this.highlighter,this.options);return this.copyStateTo(t),t.#e=this.#e,t.#t=this.#t,t}resetSource(){this.#e=``,this.#t=void 0}releaseSource(){this.resetSource()}},T=class e extends s{raw;loadedThemes=new Map;attachedLanguages=new Set([`text`,`ansi`]);static async create(t){let n=t===`shiki-wasm`?(await o(async()=>{let{createOnigurumaEngine:e}=await import(`./engine-oniguruma-Dl5gvpE_.js`);return{createOnigurumaEngine:e}},__vite__mapDeps([3,4,5]))).createOnigurumaEngine(o(()=>import(`./wasm-BnjxR4X6.js`),[])):(await o(async()=>{let{createJavaScriptRegexEngine:e}=await import(`./engine-javascript-DKxkqixV.js`);return{createJavaScriptRegexEngine:e}},[])).createJavaScriptRegexEngine(),r=await d({themes:[],langs:[],engine:n});return new e(t,r)}constructor(e,t){super(e,i(e)),this.raw=t}getTheme(e){this.assertNotDisposed();let t=this.loadedThemes.get(e),n=this.themeResolver.getResolvedTheme(e)??t;if(n==null)throw Error(`Theme "${e}" has not been resolved`);if(t!==n){let t=n.textmate??(n.cssVariables==null?void 0:f(n.cssVariables));if(t==null)throw Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...t,name:e}),this.loadedThemes.set(e,n)}return n}codeToTokens(e,t){return this.raw.codeToTokens(e,this.resolveOptions(t))}createEditorTokenizer(e){return new x(this.raw,e,this)}createStreamTokenizer(e){return new w(this.raw,this.resolveOptions(e))}async loadLanguages(e){this.assertNotDisposed(),m(await _(e.filter(e=>!this.attachedLanguages.has(e))),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let n;return e.every(e=>this.attachedLanguages.has(e)?!0:!t.has(e)&&(n??=this.raw.getLoadedLanguages(),n.includes(e)))}attachLanguages(e){this.assertNotDisposed();for(let t of e){if(this.attachedLanguages.has(t.name))continue;let e=t.data.find(e=>e.name===t.name||e.aliases?.includes(t.name)===!0);if(e==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${t.name}" as its name or an alias.`);this.raw.loadLanguageSync(t.data);try{this.raw.getLanguage(t.name)}catch{throw Error(`attachResolvedLanguages: "${e.name}" is already loaded without alias "${t.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(t.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:t,...n}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...n,theme:e};if(t==null)throw Error(`A theme or themes option is required`);for(let e of Object.values(t))this.getTheme(e);return{...n,themes:t}}};export{T as ShikiHighlighter,m as i,g as n,h as r,_ as t};
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./constants-CmGPilXJ.js";import{d as i,f as a}from"./renderTokenLines-CZITQnBN.js";import{t as o}from"./preload-helper-BLdHbfdN.js";import{n as s,t as c}from"./stream-tokenizer-bYvWJIhm.js";import{G as l,U as u,c as d,s as f}from"./dist-TdUDcI9m.js";import{t as p}from"./appendItems-BzU1_nhw.js";function m(e,t){for(let i of Array.isArray(e)?e:[e]){let e=n.get(i.name);e??(e=i,n.set(i.name,e)),t.attachLanguages([e]),r.add(e.name)}}async function h(r){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:a())throw Error(`resolveLanguage("${r}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let i=e.get(r);if(i!=null)return i;let s=(async()=>{let e=t.get(r);if(e==null){let{bundledLanguages:t}=await o(async()=>{let{bundledLanguages:e}=await import(`./langs-DdlLhtBb.js`);return{bundledLanguages:e}},__vite__mapDeps([0,1,2]));Object.prototype.hasOwnProperty.call(t,r)&&(e=t[r])}if(e==null)throw Error(`resolveLanguage: "${r}" not found in bundled or custom languages`);let{default:i}=await e(),a={name:r,data:i};return n.has(r)||n.set(r,a),a})();e.set(r,s);try{return await s}finally{e.get(r)===s&&e.delete(r)}}function g(e){return n.get(e)??h(e)}async function _(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=g(r)??h(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function v(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var y=0,b=0,x=class{backend;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=[l];#d=[];#f=0;#p=[];#m=-1;#h=!0;#g=!1;#_=0;#v=++b;#y=-1;#b=-1;#x;#S=0;#C=[];#w=!1;#T=v(async e=>{if(this.#l)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#i.lineCount);if(this.#t==null&&!C(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#l)return;this.#t=this.#e.getLanguage(this.#i.languageId)}this.#D(),this.#N(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#v&&typeof r==`number`&&r===this.#_&&(this.#y>=0?this.#z(r):this.#B(r))};getStringCommentRegexpRangesInLine(e){if(!this.#s||e<0||e>=this.#i.lineCount||(this.#O(),this.#t==null))return null;if(this.#C[e]===void 0){this.#R(e);let t=this.#u[e]??l,n=this.#P(e,t);this.#u[e+1]=n.state}return this.#C[e]??null}constructor(e,t,n){this.backend=n,this.#e=e,this.#i=t.textDocument,this.#n=t.theme,this.#r=[],this.#a=t.tokenizeMaxLineLength??1e3,this.#o=t.onDeferTokenize,this.#s=t.matchBrackets!==!1,this.#c=t.__debug??!1,this.#O(),this.#D()}setTheme(e){this.#n!==e&&(this.#n=e,this.#D(),this.stopBackgroundTokenize(),this.#u=[l],this.#d=[],this.#f=0,this.#p=[],this.#t!=null&&this.#i.lineCount>0&&this.#M(0))}#D(){if(this.#n===``)return;this.backend?.getTheme(this.#n);let{colorMap:e}=this.#e.setTheme(this.#n);this.#r=e}dispose(){this.#l=!0,this.stopBackgroundTokenize(),this.#A()}tokenize(e,t,n=!1){if(this.#O(),this.#D(),this.#t==null&&!C(this.#i.languageId))throw Error(`Grammar for language "${this.#i.languageId}" not loaded`);let{lineCount:r}=this.#i,{startingLine:i=0,totalLines:a=1/0}=t??{},o=a===1/0?r:Math.min(i+a,r),s=e.startLine,c=Math.max(i,s),u=t!=null&&a!==1/0&&e.lineDelta>0&&s<o&&e.endLine>=o,d=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0);this.#s&&!d&&(this.#C.length=Math.min(this.#C.length,e.startLine));let f=n&&e.lineDelta!==0&&s>=i,p=d||t==null||s>=c,m=e.changedLineRanges??[[s,e.endLine]];this.#d=[],this.#f=0,this.#p=[];let h=-1;if(s<c)for(let[e,t]of m)e<c&&(h=Math.max(h,Math.min(t,c-1)));let g=h>=s&&(d||e.lineDelta<0);d?this.#R(s):(this.#I(e),(t==null||s>=c)&&this.#R(c));let _=0,v=m[_][1],y,b=0,x=d?m[_][0]:c,S=!1,w=new Map,T=g?new Map:void 0;if(T!=null&&!d){let e=Math.min(h+1,c,o);if(e>s){this.#R(e);let t=s,n=this.#u[t]??l;for(;t<e;t++){let e=this.#P(t,n);n=e.state,T.set(t,e.resolvedTokens)}this.#u[e]=n}}let E=this.#u[x]??l;for(;x<o;){let e=d?this.#u[x+1]:f?this.#L(x+1):void 0;p&&(this.#u[x]=E);let{resolvedTokens:t,state:n}=this.#P(x,E);if(E=n,x>=c?w.set(x,t):T?.set(x,t),p&&(this.#u[x+1]=E),S=x>=v&&(d||f)&&e!=null&&E.equals(e),S){_++;let e=m[_];if(e==null)break;if(e[0]>=o){y=e[0],b=_;break}let t=this.#u[e[0]];if(f)for(let n=x+2;n<=e[0]&&(t=this.#L(n),t!=null);n++)this.#u[n]=t;t==null?(v=e[1],x++):(x=e[0],E=t,v=e[1]),S=!1}else x++}if(p&&(x<o?this.#u[x+1]=E:this.#u[x]=E),S&&f&&y==null){for(let e=x+2;e<=r;e++){let t=this.#L(e);if(t==null)break;this.#u[e]=t}this.#d=[],this.#f=0,this.#p=[]}if(T!=null&&T.size>0&&this.#o(T),y!=null)this.#s&&d&&(this.#C.length=Math.min(this.#C.length,y)),this.#M(y,m,b);else if(!S&&x<r){let e=u&&s>=c?o:s<c&&!d?s:x;this.#s&&d&&(this.#C.length=Math.min(this.#C.length,e)),this.#M(e,m,_)}return w}prebuildStateStack(e){this.#O(),this.#T(e)}stopBackgroundTokenize(){this.#b=-1,this.#h||(this.#h=!0,this.#g=!1,this.#m=-1,this.#y=-1,this.#x=void 0,this.#S=0,this.#d=[],this.#f=0,this.#p=[],this.#A())}pauseBackgroundTokenize(){this.#h||this.#g||(this.#c&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#_}),this.#g=!0)}resumeBackgroundTokenize(){this.#h||!this.#g||this.#t==null||this.#m<0||(this.#c&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#_}),this.#g=!1,this.#j(this.#_))}#O(){this.#t==null&&!C(this.#i.languageId)&&this.#e.getLoadedLanguages().includes(this.#i.languageId)&&(this.#t=this.#e.getLanguage(this.#i.languageId))}#k(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#A(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#j(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#v,jobId:e})}#M(e,t,n=0){if(C(this.#i.languageId))return;let r=++this.#_;this.#c&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#h=!1,this.#g=!1,this.#m=e,this.#y>=0&&(this.#b=Math.max(this.#b,this.#y)),this.#y=-1,this.#x=t,this.#S=n,this.#k(),this.#j(r)}#N(e){if(this.#t==null||this.#u.length>e)return;if(!this.#h){this.#y>=0?this.#y=Math.max(this.#y,e):this.#b=Math.max(this.#b,e);return}let t=++this.#_;this.#h=!1,this.#g=!1,this.#m=this.#u.length-1,this.#y=e,this.#b=-1,this.#x=void 0,this.#S=0,this.#k(),this.#j(t)}#P(e,t){let n=this.#i.getLineText(e);if(n.length>=this.#a)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t==null||n===``||n.trim()===``)return this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=S(this.#t,this.#r,n,t,y,this.#s);return this.#F(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#F(e,t){this.#s&&(this.#C[e]=t)}#I(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#u.length-n?(this.#d=this.#u,this.#f=0,this.#u=this.#u.slice(0,n)):(this.#f=n,this.#d=this.#u.slice(n),this.#u.length=Math.min(this.#u.length,n)),this.#p=t}#L(e){let t=e;for(let n=this.#p.length-1;n>=0;n--){let[r,i,a]=this.#p[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#u[e]}}return this.#d[t-this.#f]??this.#u[e]}#R(e,t){let n=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#u.length>n||this.#t==null)return!0;let r=t==null?0:performance.now(),i=this.#u.length-1,a=this.#u[i]??l;for(;i<n;){this.#u[i]=a;let e=this.#i.getLineText(i);if(e.length<this.#a&&e!==``&&e.trim()!==``){let t=S(this.#t,this.#r,e,a,y,this.#s,!1);this.#F(i,t.bracketIgnoredRanges),a=t.ruleStack}else this.#F(i,null);if(i++,this.#u[i]=a,t!=null&&performance.now()-r>t)break}return i>=n}#z(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=this.#R(this.#y,1);this.#h||this.#g||e!==this.#_||(t?this.stopBackgroundTokenize():(this.#m=this.#u.length-1,this.#j(e)))}#B(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=performance.now(),n=new Map,r=this.#i.lineCount,i=this.#x,a=this.#m,o=this.#u[a]??l,s=!1,c=this.#S,u=i?.[c]?.[1];for(;a<r;){this.#u[a]=o;let e=u==null?void 0:this.#L(a+1),r=this.#P(a,o);if(n.set(a,r.resolvedTokens),o=r.state,this.#u[a+1]=o,s=u!=null&&a>=u&&e!=null&&o.equals(e),a++,s){c++;let e=i?.[c];if(e==null)break;if(u=e[1],this.#u[e[0]]==null)s=!1;else{a=e[0],o=this.#u[a]??o,s=!1;continue}}if(performance.now()-t>1)break}if(this.#o(n),!(this.#h||this.#g||e!==this.#_)){if(s||a>=r){let e=this.#b;this.stopBackgroundTokenize(),e>=0&&this.#N(e)}else this.#m=a,this.#S=c,this.#j(e)}}};function S(e,t,n,r,i,a=!0,o=!0){let s=e.tokenizeLine2(n,r,i);s.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let c=s.tokens,l=c.length/2,d=[],f=[];if(!o&&!a)return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let e=0;e<l;e++){let r=c[2*e],i=e+1<l?c[2*e+2]:n.length;if(r===i)continue;let s=c[2*e+1];if(o){let e=u.getForeground(s);d.push([r,t[e],n.slice(r,i)])}a&&u.getTokenType(s)>0&&f.push([r,i])}return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function C(e){return e===`text`||e===`ansi`}var w=class e extends c{highlighter;options;#e=``;#t;constructor(e,t){super(),this.highlighter=e,this.options=t}tokenizeChunk(e,t){let n=(this.#e+e).split(/(\r\n|\r|\n)/),r=[];for(let e=0;e<n.length;e+=2){let i=n[e],a=this.highlighter.codeToTokens(i,{...this.options,grammarState:this.#t}),o=a.tokens[0].map(e=>({...e,offset:e.offset+this.stableOffset}));e+1<n.length?(p(t,o),this.pushLineBreak(t,i.length,n[e+1]),this.#t=a.grammarState):(r=o,this.#e=i)}return{unstable:r,tailLength:this.#e.length}}clone(){this.assertActive();let t=new e(this.highlighter,this.options);return this.copyStateTo(t),t.#e=this.#e,t.#t=this.#t,t}resetSource(){this.#e=``,this.#t=void 0}releaseSource(){this.resetSource()}},T=class e extends s{raw;loadedThemes=new Map;attachedLanguages=new Set([`text`,`ansi`]);static async create(t){let n=t===`shiki-wasm`?(await o(async()=>{let{createOnigurumaEngine:e}=await import(`./engine-oniguruma-Dl5gvpE_.js`);return{createOnigurumaEngine:e}},__vite__mapDeps([3,4,5]))).createOnigurumaEngine(o(()=>import(`./wasm-BnjxR4X6.js`),[])):(await o(async()=>{let{createJavaScriptRegexEngine:e}=await import(`./engine-javascript-DKxkqixV.js`);return{createJavaScriptRegexEngine:e}},[])).createJavaScriptRegexEngine(),r=await d({themes:[],langs:[],engine:n});return new e(t,r)}constructor(e,t){super(e,i(e)),this.raw=t}getTheme(e){this.assertNotDisposed();let t=this.loadedThemes.get(e),n=this.themeResolver.getResolvedTheme(e)??t;if(n==null)throw Error(`Theme "${e}" has not been resolved`);if(t!==n){let t=n.textmate??(n.cssVariables==null?void 0:f(n.cssVariables));if(t==null)throw Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...t,name:e}),this.loadedThemes.set(e,n)}return n}codeToTokens(e,t){return this.raw.codeToTokens(e,this.resolveOptions(t))}createEditorTokenizer(e){return new x(this.raw,e,this)}createStreamTokenizer(e){return new w(this.raw,this.resolveOptions(e))}async loadLanguages(e){this.assertNotDisposed(),m(await _(e.filter(e=>!this.attachedLanguages.has(e))),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let n;return e.every(e=>this.attachedLanguages.has(e)?!0:!t.has(e)&&(n??=this.raw.getLoadedLanguages(),n.includes(e)))}attachLanguages(e){this.assertNotDisposed();for(let t of e){if(this.attachedLanguages.has(t.name))continue;let e=t.data.find(e=>e.name===t.name||e.aliases?.includes(t.name)===!0);if(e==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${t.name}" as its name or an alias.`);this.raw.loadLanguageSync(t.data);try{this.raw.getLanguage(t.name)}catch{throw Error(`attachResolvedLanguages: "${e.name}" is already loaded without alias "${t.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(t.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:t,...n}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...n,theme:e};if(t==null)throw Error(`A theme or themes option is required`);for(let e of Object.values(t))this.getTheme(e);return{...n,themes:t}}};export{T as ShikiHighlighter,m as i,g as n,h as r,_ as t};
|
package/apps/client/dist/assets/{stream-tokenizer-DZPEnOzC.js → stream-tokenizer-bYvWJIhm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e,m as t,p as n,t as r}from"./renderTokenLines-
|
|
1
|
+
import{g as e,m as t,p as n,t as r}from"./renderTokenLines-CZITQnBN.js";import{n as i}from"./appendItems-BzU1_nhw.js";function a(e,t,n,a=!1){let o=[0];if(n.decorations?.some(e=>typeof e.start==`number`||typeof e.end==`number`)===!0)for(let t=e.indexOf(`
|
|
2
2
|
`);t!==-1;t=e.indexOf(`
|
|
3
3
|
`,t+1))o.push(t+1);let s={type:`element`,tagName:`code`,properties:{},children:[]},c=r(t.tokens,{decorations:n.decorations,mergeWhitespaces:n.mergeWhitespaces,lineOffsets:o,cacheHtmlStyles:a});for(let e=0;e<c.length;e++)e>0&&s.children.push({type:`text`,value:`
|
|
4
4
|
`}),s.children.push(c[e]);let l={type:`root`,children:[{type:`element`,tagName:`pre`,properties:{class:`diffs`,style:t.rootStyle===!1?void 0:t.rootStyle??[t.fg==null?``:`color:${t.fg}`,t.bg==null?``:`background-color:${t.bg}`].filter(Boolean).join(`;`),tabIndex:0},children:[s]}]};return i(l)}var o=class{name;themeResolver;disposed=!1;constructor(e,n){this.name=e,this.themeResolver=n,t(e)}codeToHtml(e,t){return a(e,this.codeToTokens(e,t),t,this.name===`highlights`)}get isDisposed(){return this.disposed}dispose(){this.disposed||(this.disposed=!0,this.releaseResources(),e())}assertNotDisposed(){if(this.disposed)throw new n}},s=class{disposed=!1;stableOffset=0;unstable=[];pendingCarriageReturn=``;enqueue(e){this.assertActive(),e=this.pendingCarriageReturn+e,this.pendingCarriageReturn=e.endsWith(`\r`)?`\r`:``,this.pendingCarriageReturn!==``&&(e=e.slice(0,-1));let t=this.unstable.length,n=[],{unstable:r,tailLength:i}=this.tokenizeChunk(e,n);return this.pendingCarriageReturn!==``&&r.push({content:`\r`,offset:this.stableOffset+i}),this.unstable=r,{recall:t,stable:n,unstable:r}}pushLineBreak(e,t,n){for(let r=0;r<n.length;r++)e.push({content:n[r],offset:this.stableOffset+t+r});this.stableOffset+=t+n.length}close(){let e=this.unstable;return this.dispose(),{stable:e}}clear(){this.assertActive(),this.stableOffset=0,this.unstable=[],this.pendingCarriageReturn=``,this.resetSource()}dispose(){this.disposed||(this.disposed=!0,this.unstable=[],this.releaseSource())}copyStateTo(e){e.stableOffset=this.stableOffset,e.unstable=this.unstable.slice(),e.pendingCarriageReturn=this.pendingCarriageReturn}assertActive(){if(this.disposed)throw Error(`stream tokenizer is disposed`)}};export{o as n,a as r,s as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-yhRGiujn.js","assets/dist-TdUDcI9m.js","assets/ccount-D7kz22QW.js","assets/rolldown-runtime-COiEfhsA.js","assets/lib-m_q9jTTN.js","assets/core-BvRk9kiK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./unwrapDefault-ByDmBtHB.js";import{t}from"./preload-helper-BLdHbfdN.js";function n(e){let t=[],i=new Set;for(let n of r(e.themes)){let e=o(n)?n.getThemes():[n];for(let n of e){if(i.has(n.name))throw Error(`Theme collection already contains theme "${n.name}"`);i.add(n.name),t.push(n)}}let a=Object.freeze([...t]),s=Object.freeze(a.filter(e=>e.colorScheme===`light`)),c=Object.freeze(a.filter(e=>e.colorScheme===`dark`)),l=new Map(a.map(e=>[e.name,e])),u=Object.freeze(a.map(e=>e.name)),d=Object.freeze(s.map(e=>e.name)),f=Object.freeze(c.map(e=>e.name));function p(e){if(e==null)return a;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?s:t===`dark`?c:a:a.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return l.get(e)},getThemes(e){return p(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?d:e?.colorScheme===`dark`?f:u:p(e).map(e=>e.name)},hasTheme(e){return l.has(e)},orderBy(e){return n({themes:a.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],r=new Set;for(let n of e){if(r.has(n))throw Error(`Theme collection pick already includes theme "${n}"`);r.add(n);let e=l.get(n);if(e==null)throw Error(`Theme collection does not contain theme "${n}"`);t.push(e)}return n({themes:t})},registerInto(e){for(let t of a)e.registerThemeIfAbsent(t.name,t.load)}}}function r(e){return i(e)?[e]:e}function i(e){return o(e)||a(e)}function a(e){return typeof e.name==`string`&&typeof e.load==`function`}function o(e){return typeof e.getThemes==`function`}function s({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:c(t)}}function c(n){return async()=>{let[r,{normalizeTheme:i}]=await Promise.all([n(),t(()=>import(`./core-yhRGiujn.js`),__vite__mapDeps([0,1,2,3,4,5]))]);return i(e(r))}}var l=`pierre`,u=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],d=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],f=[...d,...u],p=new Set(d);function m(e){return p.has(e)?`light`:`dark`}var h={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},g={"pierre-dark":()=>t(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>t(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>t(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>t(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>t(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>t(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>t(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>t(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>t(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>t(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function _(e){return s({name:e,collection:l,colorScheme:m(e),displayName:h[e],load:g[e]})}var v=n({themes:f.map(e=>_(e))}),y=`shiki`,b=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],x=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),S=new Set(b);function C(e){return S.has(e)?`light`:`dark`}var w={andromeeda:()=>t(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>t(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>t(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>t(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>t(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>t(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>t(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>t(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>t(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>t(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>t(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>t(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>t(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>t(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>t(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>t(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>t(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>t(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>t(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>t(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>t(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>t(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>t(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>t(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>t(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>t(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>t(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>t(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>t(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>t(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>t(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>t(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>t(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>t(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>t(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>t(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>t(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>t(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>t(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>t(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>t(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>t(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>t(()=>import(`./monokai-BscAjiQZ.js`),[]),"night-owl":()=>t(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>t(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>t(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>t(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]),"one-light":()=>t(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>t(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>t(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>t(()=>import(`./red-CYlAq2b0.js`),[]),"rose-pine":()=>t(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>t(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>t(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>t(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>t(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>t(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>t(()=>import(`./solarized-dark-b97czJOk.js`),[]),"solarized-light":()=>t(()=>import(`./solarized-light-DFPxpIYQ.js`),[]),"synthwave-84":()=>t(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>t(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>t(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>t(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>t(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>t(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function T(e){return s({name:e,collection:y,colorScheme:C(e),load:w[e]})}var E=n({themes:Object.freeze([...b.map(e=>T(e)),...x.map(e=>T(e))])}),D=n({themes:[v,E]});export{s as createTheme,v as pierreThemes,E as shikiThemes,D as themes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{c as t,l as n}from"./utils-U6QfaJBO.js";import{_ as r,c as i,d as a,f as o,h as s,i as c,l,m as u,o as d,p as f,t as p,u as m}from"./dist-C_Y10kCd.js";import{i as h,r as g}from"./button-CWFREsRn.js";var _=[[`path`,{d:`M12 4V20M20 12H4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],v=e(r(),1),y=e(n(),1),b=t(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0}),C=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),w=y.forwardRef(S(function(e,t){return(0,b.jsx)(s.span,{...e,ref:t,style:{...C,...e.style}})},`VisuallyHidden`)),T=Object.defineProperty,E=(e,t)=>T(e,`name`,{value:t,configurable:!0});function D(e){let[t,n]=y.useState(void 0);return f(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}E(D,`useSize`);var O=[`top`,`right`,`bottom`,`left`],k=Math.min,A=Math.max,j=Math.round,M=Math.floor,N=e=>({x:e,y:e}),P={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function F(e,t,n){return A(e,k(t,n))}function I(e,t){return typeof e==`function`?e(t):e}function L(e){return e.split(`-`)[0]}function R(e){return e.split(`-`)[1]}function ee(e){return e===`x`?`y`:`x`}function z(e){return e===`y`?`height`:`width`}function B(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function V(e){return ee(B(e))}function te(e,t,n){n===void 0&&(n=!1);let r=R(e),i=V(e),a=z(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ue(o)),[o,ue(o)]}function ne(e){let t=ue(e);return[re(e),t,re(t)]}function re(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ie=[`left`,`right`],ae=[`right`,`left`],oe=[`top`,`bottom`],se=[`bottom`,`top`];function ce(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ae:ie:t?ie:ae;case`left`:case`right`:return t?oe:se;default:return[]}}function le(e,t,n,r){let i=R(e),a=ce(L(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(re)))),a}function ue(e){let t=L(e);return P[t]+e.slice(t.length)}function de(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function fe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:de(e)}function pe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function me(e,t,n){let{reference:r,floating:i}=e,a=B(t),o=V(t),s=z(o),c=L(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=R(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function he(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=I(t,e),p=fe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=pe(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=pe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ge=50,_e=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:he},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=me(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ge&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=me(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ve=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=I(e,t)||{};if(l==null)return{};let d=fe(u),f={x:n,y:r},p=V(i),m=z(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=k(d[_],T),D=k(d[v],T),O=C-h[m]-D,A=C/2-h[m]/2+w,j=F(E,A,O),M=!c.arrow&&R(i)!=null&&A!==j&&a.reference[m]/2-(A<E?E:D)-h[m]/2<0,N=M?A<E?A-E:A-O:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),ye=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=I(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=L(r),_=B(o),v=L(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ue(o)]:ne(o)),x=p!==`none`;!d&&x&&b.push(...le(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=te(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===B(t)||T.every(e=>B(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=B(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function be(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xe(e){return O.some(t=>e[t]>=0)}var Se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=I(e,t);switch(i){case`referenceHidden`:{let e=be(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:xe(e)}}}case`escaped`:{let e=be(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:xe(e)}}}default:return{}}}}},Ce=new Set([`left`,`top`]);async function we(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=L(n),s=R(n),c=B(n)===`y`,l=Ce.has(o)?-1:1,u=a&&c?-1:1,d=I(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Te=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await we(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ee=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=I(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=B(i),p=ee(f),m=u[p],h=u[f],g=(e,t)=>F(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},De=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=I(e,t),u={x:n,y:r},d=B(i),f=ee(d),p=u[f],m=u[d],h=I(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ce.has(L(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Oe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=I(e,t),c=await i.detectOverflow(t,s),l=L(n),u=R(n),d=B(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=k(p-c[m],g),y=k(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*A(c.left,c.right):S=p-2*A(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ke(){return typeof window<`u`}function H(e){return Ae(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){return((Ae(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ae(e){return ke()?e instanceof Node||e instanceof U(e).Node:!1}function G(e){return ke()?e instanceof Element||e instanceof U(e).Element:!1}function K(e){return ke()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function je(e){return!ke()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function Me(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ne(e){return/^(table|td|th)$/.test(H(e))}function Pe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Fe=/transform|translate|scale|rotate|perspective|filter/,Ie=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,Le;function Re(e){let t=G(e)?J(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!Be()&&(q(t.backdropFilter)||q(t.filter))||Fe.test(t.willChange||``)||Ie.test(t.contain||``)}function ze(e){let t=Y(e);for(;K(t)&&!Ve(t);){if(Re(t))return t;if(Pe(t))return null;t=Y(t)}return null}function Be(){return Le??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Le}function Ve(e){return/^(html|body|#document)$/.test(H(e))}function J(e){return U(e).getComputedStyle(e)}function He(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(H(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||je(e)&&e.host||W(e);return je(t)?t.host:t}function Ue(e){let t=Y(e);return Ve(t)?(e.ownerDocument||e).body:K(t)&&Me(t)?t:Ue(t)}function We(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ue(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=Ge(a);return t.concat(a,a.visualViewport||[],Me(r)?r:[],e&&n?We(e):[])}return t.concat(r,We(r,[],n))}function Ge(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ke(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=j(n)!==a||j(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function qe(e){return G(e)?e:e.contextElement}function X(e){let t=qe(e);if(!K(t))return N(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ke(t),o=(a?j(n.width):n.width)/r,s=(a?j(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Je=N(0);function Ye(e){let t=U(e);return!Be()||!t.visualViewport?Je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=qe(e),o=N(1);t&&(r?G(r)&&(o=X(r)):o=X(e));let s=Xe(a,n,r)?Ye(a):N(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=U(a),t=G(r)?U(r):r,n=e,i=Ge(n);for(;i&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=U(i),i=Ge(n)}}return pe({width:u,height:d,x:c,y:l})}function Ze(e,t){let n=He(e).scrollLeft;return t?t.left+n:Z(W(e)).left+n}function Qe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ze(e,n),y:n.top+t.scrollTop}}function $e(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=W(r),s=t?Pe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=N(1),u=N(0),d=K(r);if((d||!a)&&((H(r)!==`body`||Me(o))&&(c=He(r)),d)){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qe(o,c):N(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function et(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tt(e){let t=He(e),n=e.ownerDocument.body,r=A(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=A(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ze(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=A(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var nt=25;function rt(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=U(e),a=W(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Be()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ze(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=nt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function it(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function at(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=rt(e,n,t);else if(t===`document`)r=tt(W(e));else if(G(t))r=it(t,n);else{let n=Ye(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pe(r)}function ot(e,t){let n=t.get(e);if(n)return n;let r=We(e,[],!1).filter(e=>G(e)&&H(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;G(o)&&!Ve(o);){let e=J(o),t=Re(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function st(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Pe(t)?[]:ot(t,this._c):[].concat(n),r],o=at(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=at(t,a[e],i);s=A(n.top,s),c=k(n.right,c),l=k(n.bottom,l),u=A(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ct(e){let{width:t,height:n}=Ke(e);return{width:t,height:n}}function lt(e,t,n){let r=K(t),i=W(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=N(0);if((r||!a)&&((H(t)!==`body`||Me(i))&&(s=He(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ze(i));let l=i&&!r&&!a?Qe(i,s):N(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ut(e){return J(e).position===`static`}function dt(e,t){if(!K(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function ft(e,t){let n=U(e);if(Pe(e))return n;if(!K(e)){let t=Y(e);for(;t&&!Ve(t);){if(G(t)&&!ut(t))return t;t=Y(t)}return n}let r=dt(e,t);for(;r&&Ne(r)&&ut(r);)r=dt(r,t);return r&&Ve(r)&&ut(r)&&!Re(r)?n:r||ze(e)||n}var pt=async function(e){let t=this.getOffsetParent||ft,n=this.getDimensions,r=await n(e.floating);return{reference:lt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mt(e){return J(e).direction===`rtl`}var ht={convertOffsetParentRelativeRectToViewportRelativeRect:$e,getDocumentElement:W,getClippingRect:st,getOffsetParent:ft,getElementRects:pt,getClientRects:et,getDimensions:ct,getScale:X,isElement:G,isRTL:mt};function gt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _t(e,t,n){let r=null,i,a=W(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=M(d),h=M(a.clientWidth-(u+f)),g=M(a.clientHeight-(d+p)),_=M(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:A(0,k(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=U(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=qe(e),u=i||a?[...l?We(l):[],...t?We(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_t(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!gt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var yt=Te,bt=Ee,xt=ye,St=Oe,Ct=Se,wt=ve,Tt=De,Et=(e,t,n)=>{let r=new Map,i=n??{},a={...ht,...i.platform,_c:r};return _e(e,t,{...i,platform:a})},Dt=typeof document<`u`?y.useLayoutEffect:function(){};function Ot(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ot(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ot(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function kt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function At(e,t){let n=kt(e);return Math.round(t*n)/n}function jt(e){let t=y.useRef(e);return Dt(()=>{t.current=e}),t}function Mt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);Ot(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),b=y.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=y.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=y.useRef(null),T=y.useRef(null),E=y.useRef(u),D=c!=null,O=jt(c),k=jt(i),A=jt(l),j=y.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),Et(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Ot(E.current,t)&&(E.current=t,v.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Dt(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=y.useRef(!1);Dt(()=>(M.current=!0,()=>{M.current=!1}),[]),Dt(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=y.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=y.useMemo(()=>({reference:S,floating:C}),[S,C]),F=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=At(P.floating,u.x),r=At(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...kt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Nt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:wt({element:r.current,padding:i}).fn(n):r?wt({element:r,padding:i}).fn(n):{}}}},Pt=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ft=(e,t)=>{let n=bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},It=(e,t)=>({fn:Tt(e).fn,options:[e,t]}),Lt=(e,t)=>{let n=xt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rt=(e,t)=>{let n=St(e);return{name:n.name,fn:n.fn,options:[e,t]}},zt=(e,t)=>{let n=Ct(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=Object.defineProperty,Q=(e,t)=>Vt(e,`name`,{value:t,configurable:!0}),Ht={Partial:`partial`,Always:`always`},Ut={Optimized:`optimized`,Always:`always`},Wt=`Popper`,[Gt,Kt]=u(Wt),[qt,Jt]=Gt(Wt),Yt=Q(e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null),[a,o]=y.useState(void 0);return(0,b.jsx)(qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Xt=`PopperAnchor`,Zt=y.forwardRef(Q(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Jt(Xt,n),o=y.useRef(null),c=a.onAnchorChange,l=y.useCallback(e=>{o.current=e,e&&c(e)},[c]),u=h(t,l),d=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=a.placementState&&an(a.placementState),p=f?.[0],m=f?.[1];return r?null:(0,b.jsx)(s.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...i,ref:u})},`PopperAnchor`)),Qt=`PopperContent`,[$t,en]=Gt(Qt),tn=y.forwardRef(Q(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m=Ht.Partial,hideWhenDetached:g=!1,updatePositionStrategy:_=Ut.Optimized,onPlaced:v,...x}=e,S=Jt(Qt,n),[C,w]=y.useState(null),T=h(t,w),[E,O]=y.useState(null),k=D(E),A=k?.width??0,j=k?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(d)?d:[d],F=P.length>0,I={padding:N,boundary:P.filter(nn),altBoundary:F},{refs:L,floatingStyles:R,placement:ee,isPositioned:z,middlewareData:B}=Mt({strategy:`fixed`,placement:M,whileElementsMounted:Q((...e)=>vt(...e,{animationFrame:_===Ut.Always}),`whileElementsMounted`),elements:{reference:S.anchor},middleware:[Pt({mainAxis:a+j,alignmentAxis:c}),u&&Ft({mainAxis:!0,crossAxis:!1,...m===Ht.Partial?{limiter:It()}:{},...I}),u&&Lt({...I}),Rt({...I,apply:Q(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),E&&Bt({element:E,padding:l}),rn({arrowWidth:A,arrowHeight:j}),g&&zt(F?{strategy:`referenceHidden`,...I}:{strategy:`referenceHidden`,padding:I.padding,altBoundary:I.altBoundary})]}),V=S.setPlacementState;f(()=>(V(ee),()=>{V(void 0)}),[ee,V]);let[te,ne]=an(ee),re=i(v);f(()=>{z&&re?.()},[z,re]);let ie=B.arrow?.x,ae=B.arrow?.y,oe=B.arrow?.centerOffset!==0,[se,ce]=y.useState();return f(()=>{C&&ce(window.getComputedStyle(C).zIndex)},[C]),(0,b.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:z?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)($t,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:O,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,b.jsx)(s.div,{"data-side":te,"data-align":ne,...x,ref:T,style:{...x.style,animation:z?x.style?.animation:`none`}})})})},`PopperContent`));function nn(e){return e!==null}Q(nn,`isNotNull`);var rn=Q(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=an(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function an(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Q(an,`getSideAndAlignFromPlacement`);var on=Object.defineProperty,$=(e,t)=>on(e,`name`,{value:t,configurable:!0}),[sn,cn]=u(`Tooltip`,[Kt]),ln=Kt(),un=`TooltipProvider`,dn=700,fn=`tooltip.open`,[pn,mn]=sn(un),hn=$(e=>{let{__scopeTooltip:t,delayDuration:n=dn,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(pn,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),gn=`Tooltip`,[_n,vn]=sn(gn),yn=$(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,u=mn(gn,e.__scopeTooltip),d=ln(t),[f,p]=y.useState(null),[m,h]=y.useState(void 0),g=l(),_=y.useRef(0),v=s??u.disableHoverableContent,x=c??u.delayDuration,S=y.useRef(!1),[C,w]=a({prop:r,defaultProp:i??!1,onChange:$(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(fn))):u.onClose(),o?.(e)},`onChange`),caller:gn}),T=y.useMemo(()=>C?S.current?`delayed-open`:`instant-open`:`closed`,[C]),E=y.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S.current=!1,w(!0)},[w]),D=y.useCallback(()=>{window.clearTimeout(_.current),_.current=0,w(!1)},[w]),O=y.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{S.current=!0,w(!0),_.current=0},x)},[x,w]);y.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let k=m??g;return(0,b.jsx)(Yt,{...d,children:(0,b.jsx)(_n,{scope:t,contentId:k,setContentId:h,open:C,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{u.isOpenDelayedRef.current?O():E()},[u.isOpenDelayedRef,O,E]),onTriggerLeave:y.useCallback(()=>{v?D():(window.clearTimeout(_.current),_.current=0)},[D,v]),onOpen:E,onClose:D,disableHoverableContent:v,children:n})})},`Tooltip`),bn=`TooltipTrigger`,xn=y.forwardRef($(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=vn(bn,n),c=mn(bn,n),l=ln(n),u=y.useRef(null),d=h(t,u,a.onTriggerChange),f=y.useRef(!1),p=y.useRef(!1),m=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,m),[m]),(0,b.jsx)(Zt,{asChild:!0,...l,children:(0,b.jsx)(s.button,{"aria-describedby":a.open?Ln(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:d,onPointerMove:o(e.onPointerMove,e=>{e.pointerType!==`touch`&&!p.current&&!c.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:o(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:o(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener(`pointerup`,m,{once:!0})}),onFocus:o(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:o(e.onBlur,a.onClose),onClick:o(e.onClick,a.onClose)})})},`TooltipTrigger`)),Sn=`TooltipPortal`,[Cn,wn]=sn(Sn,{forceMount:void 0}),Tn=$(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=vn(Sn,t);return(0,b.jsx)(Cn,{scope:t,forceMount:n,children:(0,b.jsx)(m,{present:n||a.open,children:(0,b.jsx)(p,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),En=`TooltipContent`,Dn=y.forwardRef($(function(e,t){let n=wn(En,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=vn(En,e.__scopeTooltip);return(0,b.jsx)(m,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(An,{side:i,...a,ref:t}):(0,b.jsx)(On,{side:i,...a,ref:t})})},`TooltipContent`)),On=y.forwardRef($(function(e,t){let n=vn(En,e.__scopeTooltip),r=mn(En,e.__scopeTooltip),i=y.useRef(null),a=h(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Mn(r,jn(r,n.getBoundingClientRect())),a=Nn(t.getBoundingClientRect()),o=Fn([...i,...a]);s(o),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=$(e=>p(e,u),`handleTriggerLeave`),t=$(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=$(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Pn(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,b.jsx)(An,{...e,ref:a})},`TooltipContentHoverable`)),kn=g(`TooltipContent`),An=y.forwardRef($(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,u=vn(En,n),p=ln(n),{onClose:m}=u,[g,_]=y.useState(null),v=h(t,_);c(g),y.useEffect(()=>(document.addEventListener(fn,m),()=>document.removeEventListener(fn,m)),[m]),y.useEffect(()=>{if(u.trigger){let e=$(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,m]);let{setContentId:x}=u;return f(()=>(x(a),()=>{x(void 0)}),[a,x]),(0,b.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:(0,b.jsxs)(tn,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...p,...l,ref:v,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(kn,{children:r}),i?(0,b.jsx)(w,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function jn(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}$(jn,`getExitSideFromRect`);function Mn(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}$(Mn,`getPaddedExitPoints`);function Nn(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}$(Nn,`getPointsFromRect`);function Pn(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$(Pn,`isPointInPolygon`);function Fn(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),In(t)}$(Fn,`getHull`);function In(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}$(In,`getHullPresorted`);function Ln(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}$(Ln,`concatAriaDescribedby`);function Rn(e){return(0,b.jsx)(hn,{delayDuration:600,children:(0,b.jsxs)(yn,{children:[(0,b.jsx)(xn,{asChild:!0,children:e.children}),(0,b.jsx)(Tn,{children:(0,b.jsx)(Dn,{side:e.side??`top`,sideOffset:4,collisionPadding:5,className:`bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-98 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-98 relative z-[140] flex max-w-80 origin-(--radix-tooltip-content-transform-origin) rounded-md border px-2 py-1 text-xs leading-snug text-balance wrap-anywhere whitespace-normal shadow-md/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:e.label})})]})})}export{Kt as a,_ as c,tn as i,Yt as n,D as o,Zt as r,C as s,Rn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-dialog-
|
|
1
|
+
import{n as e,t}from"./preview-dialog-DvyH_XYP.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./react-BgpkckXP.js";import{c as h}from"./utils-U6QfaJBO.js";var g=h();function _(e){return(0,g.jsxs)(c,{className:`size-full outline-none [--media-background-color:black] [--media-control-background:transparent] [--media-control-hover-background:rgb(255_255_255/12%)] [--media-font-family:inherit] [--media-range-track-border-radius:9999px]`,children:[(0,g.jsx)(`video`,{slot:`media`,src:e.src,"aria-label":e.label,autoPlay:!0,playsInline:!0,preload:`auto`,className:`size-full object-contain`}),(0,g.jsx)(o,{slot:`centered-chrome`,noAutohide:!0}),(0,g.jsxs)(p,{className:`w-full bg-linear-to-t from-black/70 to-transparent px-2 pt-6 pb-1 *:p-2.5 max-sm:flex-wrap max-sm:*:p-2`,children:[(0,g.jsx)(f,{}),(0,g.jsx)(s,{seekOffset:10}),(0,g.jsx)(m,{seekOffset:10}),(0,g.jsx)(a,{className:`grow max-sm:order-first max-sm:min-h-0 max-sm:basis-full`}),(0,g.jsx)(i,{showDuration:!0,className:`max-sm:mr-auto`}),(0,g.jsx)(n,{}),(0,g.jsx)(u,{className:`max-sm:hidden`}),(0,g.jsx)(r,{}),(0,g.jsx)(l,{className:`max-sm:hidden`}),(0,g.jsx)(d,{})]})]})}function v(n){return(0,g.jsxs)(t,{open:!0,onClose:n.onClose,children:[(0,g.jsx)(e,{title:n.name}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,onClick:e=>{e.target instanceof HTMLVideoElement&&y(e.target,e.clientX,e.clientY)&&n.onClose()},children:(0,g.jsx)(_,{src:n.src,label:n.label})})]})}function y(e,t,n){if(e.videoWidth===0||e.videoHeight===0)return!1;let r=e.getBoundingClientRect(),i=Math.min(r.width/e.videoWidth,r.height/e.videoHeight);return Math.abs(t-r.left-r.width/2)>e.videoWidth*i/2||Math.abs(n-r.top-r.height/2)>e.videoHeight*i/2}export{v as VideoViewer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as ZoomableImage}from"./zoomable-image-E-lZC3nM.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{t}from"./MinusSignIcon-DGIm2EHe.js";import{c as n,t as r}from"./tooltip-wzGTbg8k.js";import{t as i,x as a}from"./button-CdLSr6OC.js";import{c as o,l as s}from"./utils-U6QfaJBO.js";var c=[[`path`,{d:`M9.13432 2.5C6.46805 2.56075 4.9107 2.81456 3.84664 3.87493C2.91537 4.80297 2.60406 6.10756 2.5 8.2M14.8657 2.5C17.532 2.56075 19.0893 2.81456 20.1534 3.87493C21.0846 4.80297 21.3959 6.10756 21.5 8.2M14.8657 21.5C17.532 21.4392 19.0893 21.1854 20.1534 20.1251C21.0846 19.197 21.3959 17.8924 21.5 15.8M9.13432 21.5C6.46805 21.4392 4.9107 21.1854 3.84664 20.1251C2.91537 19.197 2.60406 17.8924 2.5 15.8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],l=e(s()),u=o(),d=function(e,t){return Number(e.toFixed(t))},f=function(e,t){return typeof e==`number`?e:t},p=function(e,t,n){n&&typeof n==`function`&&n(e,t)},m={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},h=function(e){var t=e.animationResolve;e.animationResolve=null,t?.()},g=function(e){e.animationFrame!==null&&cancelAnimationFrame(e.animationFrame),e.animationFrame=null,e.isAnimating=!1,e.animation=null,e.velocity=null,h(e)};function _(e,t,n,r,i){if(!e.mounted)i?.();else{var a=new Date().getTime(),o=1;g(e);var s=function(){if(e.mounted&&e.animation===s){var i=new Date().getTime()-a,c=i/n,l=m[t],u=l(c);if(i>=n){e.animation=null,e.animationFrame=null;var d=e.animationResolve;e.animationResolve=null,r(o),d?.(),e.flushResizeAlignment()}else r(u),e.animationFrame=requestAnimationFrame(s)}};e.animation=s,e.animationResolve=i??null,e.animationFrame=requestAnimationFrame(s)}}function v(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function y(e,t,n,r){var i=v(t);if(!e.mounted||!i)return Promise.resolve();var a=e.setState,o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=t.scale-s,d=t.positionX-c,f=t.positionY-l;return n===0?(a(t.scale,t.positionX,t.positionY),Promise.resolve()):new Promise(function(t){_(e,r,n,function(t){e.isAnimating=t!==1,a(s+u*t,c+d*t,l+f*t)},t)})}function b(e,t,n){var r=e.clientWidth,i=e.clientHeight,a=t.offsetWidth,o=t.offsetHeight,s=a*n,c=o*n;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:r-s,newContentHeight:c,newDiffHeight:i-c}}var x=function(e,t,n,r,i,a,o){var s=e>t?n*(o?.5:1):0,c=r>i?a*(o?.5:1):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-i-c,maxPositionY:c,scaleWidthFactor:s,scaleHeightFactor:c}},S=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup,a=i.centerZoomedOut,o=i.disablePadding;if(!n||!r)throw Error(`Components are not mounted`);var s=b(n,r,t),c=s.wrapperWidth,l=s.wrapperHeight,u=s.newContentWidth,d=s.newContentHeight,f=s.newDiffWidth,p=s.newDiffHeight,m=x(c,u,f,l,d,p,!!a);o&&c>=u&&l>=d&&!a&&(m.minPositionX=0,m.maxPositionX=0,m.minPositionY=0,m.maxPositionY=0);var h=e.setup,g=h.minPositionX,_=h.maxPositionX,v=h.minPositionY,y=h.maxPositionY;return g!=null&&(m.minPositionX=c*(1-t)+g*t),_!=null&&(m.maxPositionX=_*t),v!=null&&(m.minPositionY=l*(1-t)+v*t),y!=null&&(m.maxPositionY=y*t),m},C=function(e,t,n,r){return d(r?e<t?t:e>n?n:e:e,2)},w=function(e,t){var n=S(e,t);return e.bounds=n,n};function T(e,t,n,r,i,a,o){var s=n.minPositionX,c=n.minPositionY,l=n.maxPositionX,u=n.maxPositionY,d=0,f=0;return o&&(d=i,f=a),{x:C(e,s-d,l+d,r),y:C(t,c-f,u+f,r)}}function E(e,t,n,r,i,a){var o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=r-s;return!Number.isFinite(t)||!Number.isFinite(n)?(console.error(`Mouse X and Y position were not provided!`),{x:c,y:l}):T(c-t*u,l-n*u,i,a,0,0,null)}var D=1e-7;function O(e,t,n,r,i){var a=i?r:0,o=Math.max(t-a,D),s=n+a;return!Number.isNaN(n)&&e>=s?s:!Number.isNaN(t)&&e<=o?o:Math.max(e,D)}var k=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,a=t.target,o=function(e){return!!e&&typeof e==`object`&&e.nodeType===1&&typeof e.contains==`function`},s=typeof t.composedPath==`function`?t.composedPath().some(function(e){return o(e)&&!!i?.contains(e)}):!!i?.contains(a);return!(!(r&&a&&s)||J(a,n)||Ge(a)||Y(a))},A=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!!(t&&n&&!r)},j=function(e,t){var n=e.state,r=n.positionX,i=n.positionY;e.isPanning=!0;var a=t.clientX,o=t.clientY;e.startCoords={x:a-r,y:o-i}},ee=function(e,t){var n=t.touches,r=e.state,i=r.positionX,a=r.positionY;if(e.isPanning=!0,n.length===1){var o=n[0].clientX,s=n[0].clientY;e.startCoords={x:o-i,y:s-a}}};function te(e){var t=e.state,n=t.positionX,r=t.positionY,i=t.scale,a=e.setup,o=a.disabled,s=a.limitToBounds,c=a.centerZoomedOut,l=e.wrapperComponent;if(!o&&l&&e.bounds){var u=e.bounds,d=u.maxPositionX,f=u.minPositionX,p=u.maxPositionY,m=u.minPositionY,h=n>d||n<f,g=r>p||r<m,_=E(e,n>d?l.clientWidth:e.setup.minPositionX||0,r>p?l.clientHeight:e.setup.minPositionY||0,i,e.bounds,s||c),v=_.x,y=_.y;return{scale:i,positionX:h?v:n,positionY:g?y:r}}}function M(e,t,n,r,i){var a=e.setup.limitToBounds,o=e.wrapperComponent,s=e.bounds,c=e.state,l=c.scale,u=c.positionX,d=c.positionY;if(!(o===null||s===null||t===u&&n===d)){var f=T(t,n,s,a,r,i,o),p=f.x,m=f.y;e.setState(l,p,m)}}var ne=function(e,t,n){var r=e.startCoords,i=e.state,a=e.setup.panning,o=a.lockAxisX,s=a.lockAxisY,c=i.positionX,l=i.positionY;if(!r)return{x:c,y:l};var u=t-r.x,d=n-r.y;return{x:o?c:u,y:s?l:d}},N=function(e,t,n){var r=e.setup,i=e.state,a=r.minScale,o=r.disablePadding,s=r.centerZoomedOut,c=n??i.scale;return t>0&&c>=a&&!o&&!s?t:0},P;(function(e){e.TRACK_PAD=`track_pad`,e.MOUSE=`mouse`,e.TOUCH=`touch`})(P||={});var re=function(e){var t=e.mounted,n=e.wrapperComponent,r=e.contentComponent,i=e.setup,a=i.disabled,o=i.velocityAnimation,s=i.limitToBounds,c=e.state.scale;return o.disabled||a||!t||!n||!r?!1:!s||n.clientWidth<r.offsetWidth*c||n.clientHeight<r.offsetHeight*c},ie=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,a=i.disabled;return!(i.velocityAnimation.disabled||a||!t||!n||!r)};function ae(e,t){var n=e.setup.velocityAnimation,r=n.animationTime,i=n.maxAnimationTime,a=n.inertia;return Math.min(r*Math.max(1,Math.abs(t/a)),i)}function oe(e,t,n,r,i,a,o,s,c,l){if(i){if(t>o&&n>o){var u=o+(e-o)*l;return u>c?c:u<o?o:u}if(t<a&&n<a){var u=a+(e-a)*l;return u<s?s:u>a?a:u}}return r?t:C(e,a,o,i)}function se(e){var t=1,n=e.clientWidth/window.innerWidth;return Number.isNaN(n)?t:Math.min(t,n)}var F=function(e,t,n){var r=0,i=e*n;return Number.isNaN(i)?r:e<0?Math.max(i,-t):Math.min(i,t)};function ce(e,t,n){var r,i;if(re(e)){var a=e.lastMousePosition,o=e.velocityTime,s=e.setup,c=e.wrapperComponent,l=s.velocityAnimation,u=l.maxStrengthMouse,d=l.maxStrengthTouch,f=l.sensitivityTouch,p=l.sensitivityMouse,m=Date.now();if(a&&o&&c){var h=se(c),g=(r={},r[P.TOUCH]=f,r[P.MOUSE]=p,r)[n],_=(i={},i[P.TOUCH]=d,i[P.MOUSE]=u,i)[n],v=t.x-a.x,y=t.y-a.y,b=F(v/h,_,g),x=F(y/h,_,g),S=m-o,C=v*v+y*y;e.velocity={velocityX:b,velocityY:x,total:F(Math.sqrt(C)/S,_,g)}}e.lastMousePosition=t,e.velocityTime=m}}function le(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent;if(ie(e)&&t&&n&&i){var a=t.velocityX,o=t.velocityY,s=t.total,c=n.maxPositionX,l=n.minPositionX,u=n.maxPositionY,d=n.minPositionY,f=r.limitToBounds,p=r.autoAlignment,h=r.zoomAnimation,g=r.panning,v=g.lockAxisY,y=g.lockAxisX,b=h.animationType,x=p.sizeX,S=p.sizeY,C=p.velocityAlignmentTime,w=ae(e,s),T=Math.max(w,C),E=N(e,x),D=N(e,S),O=E*i.clientWidth/100,k=D*i.clientHeight/100,A=c+O,j=l-O,ee=u+k,te=d-k,M=e.state,ne=new Date().getTime();_(e,b,T,function(t){var n=e.state,r=n.scale,i=n.positionX,s=n.positionY,h=(new Date().getTime()-ne)/C,g=m[p.animationType],_=1-g(Math.min(1,h)),b=1-t,x=i+a*b,S=s+o*b,w=oe(x,M.positionX,i,y,f,l,c,j,A,_),T=oe(S,M.positionY,s,v,f,d,u,te,ee,_);if(i!==x||s!==S){e.setState(r,w,T);var E=e.props.onPanning;E&&E(W(e),{})}})}}function ue(e,t){var n=e.state,r=n.scale;e.panStartPosition={x:n.positionX,y:n.positionY},g(e),w(e,r),`touches`in t?ee(e,t):j(e,t)}function de(e,t){var n=e.state.scale,r=e.setup,i=r.minScale,a=r.autoAlignment,o=a.disabled,s=a.sizeX,c=a.sizeY,l=a.animationTime,u=a.animationType;if(!(o||n<i||!s&&!c)){e.isResizeAlignmentPending&&w(e,n);var d=te(e);if(d){var f=e.state,p=f.positionX,m=f.positionY;(d.positionX!==p||d.positionY!==m)&&y(e,d,t??l,u)}}}function fe(e,t,n,r){var i=e.startCoords,a=e.setup.autoAlignment,o=a.sizeX,s=a.sizeY;if(i){var c=ne(e,t,n),l=c.x,u=c.y,d=N(e,o),f=N(e,s);ce(e,{x:l,y:u},r),M(e,l,u,d,f)}}function pe(e,t){if(e.isPanning){var n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1;var a=e.state,o=a.positionX,s=a.positionY,c=a.scale,l=e.panStartPosition;if(e.panStartPosition=null,l){var u=o-l.x,d=s-l.y;if(u*u+d*d<=25)return}e.isAnimating=!1,e.animation=null,e.isResizeAlignmentPending&&w(e,c);var f=r?.clientWidth||0,p=r?.clientHeight||0,m=(i?.offsetWidth||0)*c,h=(i?.offsetHeight||0)*c,g=!e.setup.limitToBounds||f<m||p<h;!t&&n&&n.total>.1&&g?le(e):de(e)}}function I(e,t,n,r){var i=e.setup,a=i.minScale,o=i.maxScale,s=i.limitToBounds,c=O(d(t,2),a,o,0,!1),l=E(e,n,r,c,w(e,c),s);return{scale:c,positionX:l.x,positionY:l.y}}function me(e,t,n){var r=e.state.scale,i=e.wrapperComponent,a=e.setup,o=a.minScale,s=a.maxScale,c=a.limitToBounds,l=a.zoomAnimation,u=l.disabled,d=l.animationTime,f=l.animationType,p=u||r>=o&&r<=s;if((r>=1||c)&&de(e),!p&&i&&e.mounted){var m=t||i.clientWidth/2,h=n||i.clientHeight/2,g=I(e,r<o?o:s,m,h);g&&y(e,g,d,f)}}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function he(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var R={previousScale:1,scale:1,positionX:0,positionY:0},z={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,fitOnInit:!1,disablePadding:!1,smooth:!0,detached:!1,wheel:{step:.015,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},trackPadPanning:{disabled:!0,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,allowPanning:!0,excluded:[]},keyboard:{disabled:!0,panStep:50,zoomStep:.25,animationTime:100,animationType:`easeOut`,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:`zoomIn`,animationType:`easeOut`,animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:`easeOut`},autoAlignment:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:`easeOut`},velocityAnimation:{disabled:!1,sensitivityMouse:1,sensitivityTouch:1.2,maxStrengthMouse:20,maxStrengthTouch:40,inertia:1,animationTime:300,maxAnimationTime:800,animationType:`easeOut`}},B={wrapperClass:`react-transform-wrapper`,contentClass:`react-transform-component`},ge=function(e){var t=Math.max(e.minScale??z.minScale,1e-7),n=e.maxScale??z.maxScale,r=e.initialScale??R.scale,i=Math.min(Math.max(r,t),n);return{previousScale:i,scale:i,positionX:C(e.initialPositionX??R.positionX,e.minPositionX??-1/0,e.maxPositionX??1/0,e.minPositionX!=null||e.maxPositionX!=null),positionY:C(e.initialPositionY??R.positionY,e.minPositionY??-1/0,e.maxPositionY??1/0,e.minPositionY!=null||e.maxPositionY!=null)}},_e=function(e){var t=L({},z);return Object.keys(e).forEach(function(n){var r=n,i=e[r]!==void 0;if(z[r]!==void 0&&i){var a=Object.prototype.toString.call(z[r]);t[r]=a===`[object Object]`?L(L({},z[r]),e[r]):a===`[object Array]`?he(he([],z[r],!0),e[r],!0):e[r]}}),t.minScale<=0&&(t.minScale=1e-7),t},ve=function(e,t,n){var r=e.state.scale,i=e.wrapperComponent,a=e.setup,o=a.maxScale,s=a.minScale,c=a.zoomAnimation.size;if(!i)throw Error(`Wrapper is not mounted`);return O(d(r+t*n,3),s,o,c,!1)};function V(e,t,n,r){var i=e.wrapperComponent,a=e.props,o=a.onZoomStart,s=a.onZoom,c=a.onZoomStop,l=new MouseEvent(`mousemove`,{bubbles:!0}),u=W(e);p(u,l,o),p(u,l,s);var d=y(e,t,n,r),f=i?.ownerDocument?.defaultView??(typeof window<`u`?window:null);return f&&f.setTimeout(function(){e.mounted&&p(W(e),l,c)},n),d}function ye(e,t,n,r,i){var a=e.wrapperComponent,o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=e.setup.zoomAnimation;if(!a)return console.error(`No WrapperComponent found`),Promise.resolve();var d=u.disabled?0:r,f=a.clientWidth,p=a.clientHeight,m=(f/2-c)/s,h=(p/2-l)/s,g=I(e,ve(e,t,n),m,h);return g?V(e,g,d,i):(console.error(`Error during zoom event. New transformation state was not calculated.`),Promise.resolve())}function be(e,t,n,r){var i=e.wrapperComponent,a=e.props,o=a.onPanningStart,s=a.onPanning,c=a.onPanningStop,l=new MouseEvent(`mousemove`,{bubbles:!0}),u=W(e);p(u,l,o),p(u,l,s);var d=y(e,t,n,r),f=i?.ownerDocument?.defaultView??(typeof window<`u`?window:null);return f&&f.setTimeout(function(){e.mounted&&p(W(e),l,c)},n),d}function H(e,t,n,r){t===void 0&&(t=`contain`);var i=e.wrapperComponent,a=e.contentComponent,o=e.setup;if(!i||!a)return null;var s=a.offsetWidth,c=a.offsetHeight,l=i.clientWidth,u=i.clientHeight;if(!s||!c||!l||!u)return null;var d=l/s,f=u/c,p=t===`cover`?Math.max(d,f):Math.min(d,f);return r!==void 0&&(p=Math.min(p,r)),n!==void 0&&(p=Math.max(p,n)),p=O(p,o.minScale,o.maxScale,0,!1),Z(p,i,a)}function xe(e,t,n,r){var i=e.setup,a=e.wrapperComponent,o=e.contentComponent,s=i.limitToBounds,c=i.centerOnInit,l=i.fitOnInit,u=ge(e.props),d=e.state,f=d.scale,p=d.positionX,m=d.positionY;if(!a)return Promise.resolve();if(l){var h=H(e,l===`cover`?`cover`:`contain`);if(h)return f===h.scale&&p===h.positionX&&m===h.positionY?Promise.resolve():(r?.(),V(e,h,t,n))}var g=u.positionX,_=u.positionY;if(c&&o){var v=Z(u.scale,a,o);g=v.positionX,_=v.positionY}var y=S(e,u.scale),b=T(g,_,y,s,0,0,a),x={scale:u.scale,positionX:b.x,positionY:b.y};return f===u.scale&&p===u.positionX&&m===u.positionY?Promise.resolve():(r?.(),V(e,x,t,n))}var Se=function(e){if(`getBoundingClientRect`in e){var t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}return e};function Ce(e){var t=e.map(Se),n=Math.min.apply(Math,t.map(function(e){return e.x})),r=Math.min.apply(Math,t.map(function(e){return e.y})),i=Math.max.apply(Math,t.map(function(e){return e.x+e.width})),a=Math.max.apply(Math,t.map(function(e){return e.y+e.height}));return{x:n,y:r,width:i-n,height:a-r}}function we(e,t,n,r){var i=Se(e),a=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=a.x*r.scale,c=a.y*r.scale;return{x:(i.x-o.x+s)/r.scale,y:(i.y-o.y+c)/r.scale}}function Te(e,t,n,r,i,a,o){r===void 0&&(r=0),i===void 0&&(i=0);var s=e.wrapperComponent,c=e.contentComponent,l=e.state,u=e.setup,d=u.limitToBounds,f=u.minScale,p=u.maxScale;if(!s||!c)return l;var m=s.getBoundingClientRect(),h=we(t,s,c,l),g=h.x,_=h.y,v=t.width/l.scale,y=t.height/l.scale,b=s.clientWidth/v,x=s.clientHeight/y,C=n||Math.min(b,x);o!==void 0&&(C=Math.min(C,o)),a!==void 0&&(C=Math.max(C,a));var w=O(C,f,p,0,!1),E=(m.width-v*w)/2,D=(m.height-y*w)/2,k=T((m.left-g)*w+E+r,(m.top-_)*w+D+i,S(e,w),d,0,0,s);return{positionX:k.x,positionY:k.y,scale:w}}function Ee(e,t,n){var r=e.wrapperComponent,i=e.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:(t-a.left-i.positionX)/i.scale,y:(n-a.top-i.positionY)/i.scale}}function De(e,t,n){var r=e.wrapperComponent,i=e.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:a.left+i.positionX+t*i.scale,y:a.top+i.positionY+n*i.scale}}var Oe=function(e){return function(t,n,r){return t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r=`easeOut`),ye(e,1,t,n,r)}},ke=function(e){return function(t,n,r){return t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r=`easeOut`),ye(e,-1,t,n,r)}},Ae=function(e){return function(t,n,r,i,a){i===void 0&&(i=300),a===void 0&&(a=`easeOut`);var o=e.state,s=o.positionX,c=o.positionY,l=o.scale,u=e.wrapperComponent,d=e.contentComponent;return e.setup.disabled||!u||!d?Promise.resolve():y(e,{positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(r)?l:r},i,a)}},je=function(e){return function(t,n){return t===void 0&&(t=200),n===void 0&&(n=`easeOut`),xe(e,t,n)}},Me=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r=`easeOut`);var i=e.state,a=e.wrapperComponent,o=e.contentComponent;return a&&o?y(e,Z(t||i.scale,a,o),n,r):Promise.resolve()}},Ne=function(e){return function(t,n,r,i,a){i===void 0&&(i=300),a===void 0&&(a=`easeOut`);var o=e.wrapperComponent,s=e.contentComponent,c=e.setup;if(c.disabled||!o||!s)return Promise.resolve();var l=Ee(e,n,r),u=I(e,t,l.x,l.y);return u?V(e,u,c.zoomAnimation.disabled?0:i,a):Promise.resolve()}},Pe=function(e){return function(t,n){return Ee(e,t,n)}},Fe=function(e){return function(t,n){return De(e,t,n)}},Ie=function(e,t){var n=e.wrapperComponent;if(!n)return[];var r=n.getRootNode(),i=r&&`getElementById`in r?r:n.ownerDocument??(typeof document<`u`?document:null);return(Array.isArray(t)?t:[t]).map(function(e){return typeof e==`string`?i?.getElementById(e):e}).filter(function(e){return!!e&&n.contains(e)})},Le=function(e){return function(t,n,r,i,a,o){r===void 0&&(r=600),i===void 0&&(i=`easeOut`),a===void 0&&(a=0),o===void 0&&(o=0),g(e);var s=typeof n==`object`&&n?n:{scale:n},c=Ie(e,t);return!e.wrapperComponent||c.length===0?Promise.resolve():y(e,Te(e,Ce(c),s.scale,s.offsetX??a,s.offsetY??o,s.minScale,s.maxScale),s.animationTime??r,s.animationType??i)}},Re=function(e){return function(t){t===void 0&&(t={});var n=e.wrapperComponent,r=e.contentComponent,i=e.setup;if(i.disabled||!n||!r)return Promise.resolve();var a=H(e,t.mode??`contain`,t.minScale,t.maxScale);return a?V(e,a,i.zoomAnimation.disabled?0:t.animationTime??200,t.animationType??`easeOut`):Promise.resolve()}},ze=function(e){return function(t,n,r,i){r===void 0&&(r=200),i===void 0&&(i=`easeOut`);var a=e.wrapperComponent,o=e.contentComponent,s=e.setup,c=e.state;if(s.disabled||!a||!o||!Number.isFinite(t)||!Number.isFinite(n))return Promise.resolve();var l=w(e,c.scale),u=T(c.positionX+t,c.positionY+n,l,s.limitToBounds,0,0,a),d=u.x,f=u.y;return d===c.positionX&&f===c.positionY?Promise.resolve():be(e,{scale:c.scale,positionX:d,positionY:f},r,i)}},U=function(e){return{instance:e,state:e.state,zoomIn:Oe(e),zoomOut:ke(e),setTransform:Ae(e),resetTransform:je(e),centerView:Me(e),zoomToElement:Le(e),zoomToPoint:Ne(e),clientToContent:Pe(e),contentToClient:Fe(e),fitToView:Re(e),panBy:ze(e)}},Be=function(e){return{instance:e,state:e.state}},W=function(e){var t={};return Object.assign(t,Be(e)),Object.assign(t,U(e)),t},G=!1;function K(){try{return{get passive(){return G=!0,!1}}}catch{return G=!1,G}}var q=`.${B.wrapperClass}`,J=function(e,t){return t.some(function(t){return e.matches(`${q} ${t}, ${q} .${t}, ${q} ${t} *, ${q} .${t} *`)})},Ve=new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`]),He=`[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]`,Ue=`[draggable="true"]`,We=function(e){return!e||typeof e.closest!=`function`?null:e},Y=function(e){var t=We(e);return t?Ve.has(t.tagName)||t.isContentEditable?!0:t.closest(He)!==null:!1},Ge=function(e){var t=We(e);return t?t.closest(Ue)!==null:!1},X=function(e){e&&clearTimeout(e)},Ke=function(e){return Number.parseFloat(e.toFixed(8))},qe=function(e,t,n){return`translate(${e}px, ${t}px) scale(${Ke(n)})`},Z=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e;return{scale:e,positionX:(t.clientWidth-r)/2,positionY:(t.clientHeight-i)/2}};function Je(e,t){e!=null&&(typeof e==`function`?e(t):e.current=t)}function Ye(e){return function(t){e.forEach(function(e){typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Xe=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ze={panLeft:[`ArrowLeft`],panRight:[`ArrowRight`],panUp:[`ArrowUp`],panDown:[`ArrowDown`],zoomIn:[`+`,`=`],zoomOut:[`-`,`_`],reset:[`0`]},Qe=function(e){return Object.values(Ze).some(function(t){return t.includes(e)})};function $e(e,t){var n=e.setup,r=n.disabled,i=n.keyboard,a=n.panning;if(r||i.disabled||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||!Qe(t.key))return!1;var o=t.target;if(Y(o)||o&&typeof o.matches==`function`&&J(o,i.excluded))return!1;var s=i.panStep,c=i.zoomStep,l=i.animationTime,u=i.animationType,d=U(e),f=t.key,p=a.lockAxisX?0:s,m=a.lockAxisY?0:s;return f===`ArrowLeft`?d.panBy(p,0,l,u):f===`ArrowRight`?d.panBy(-p,0,l,u):f===`ArrowUp`?d.panBy(0,m,l,u):f===`ArrowDown`?d.panBy(0,-m,l,u):f===`+`||f===`=`?d.zoomIn(c,l,u):f===`-`||f===`_`?d.zoomOut(c,l,u):f===`0`&&d.resetTransform(l,u),t.cancelable&&t.preventDefault(),t.stopPropagation(),!0}var et=function(e,t){return{wrapperWidth:e.offsetWidth,wrapperHeight:e.offsetHeight,contentWidth:t.offsetWidth,contentHeight:t.offsetHeight}},tt=function(e,t){return!e||e.wrapperWidth!==t.wrapperWidth||e.wrapperHeight!==t.wrapperHeight||e.contentWidth!==t.contentWidth||e.contentHeight!==t.contentHeight},nt=function(e){return e.isPanning||e.isPinching},rt=function(e){return nt(e)||e.wheelStopEventTimer!==null||e.wheelAnimationTimer!==null};function it(e){var t=e.wrapperComponent,n=e.contentComponent,r=e.setup,i=e.state;if(!t||!n)return null;var a=w(e,i.scale),o=r.limitToBounds,s=r.centerZoomedOut;if(!o&&!s)return null;var c=T(i.positionX,i.positionY,a,!0,0,0,t),l=c.x,u=c.y;return l===d(i.positionX,2)&&u===d(i.positionY,2)?null:{scale:i.scale,positionX:l,positionY:u}}var at=function(e){e.animation=null,e.animationFrame=null,e.isAnimating=!1,e.resizeAnimation=null};function ot(e){var t=e.setup.autoAlignment.animationTime,n=Math.max(t/5,1);g(e);var r=Date.now(),i=function(){if(e.mounted&&e.animation===i){var t=Date.now(),a=Math.max(t-r,1);r=t;var o=it(e);if(!o)at(e);else{var s=e.state,c=s.scale,l=s.positionX,u=s.positionY,d=1-Math.exp(-a/n),f=l+(o.positionX-l)*d,p=u+(o.positionY-u)*d,m=Math.abs(o.positionX-f)<.5&&Math.abs(o.positionY-p)<.5;m&&(f=o.positionX,p=o.positionY),e.isAnimating=!m,e.setState(c,f,p),m?at(e):e.animationFrame=requestAnimationFrame(i)}}};e.animation=i,e.resizeAnimation=i,e.animationResolve=null,e.animationFrame=requestAnimationFrame(i)}function st(e){if(e.setup.disabled)w(e,e.state.scale);else if(nt(e))e.isResizeAlignmentPending=!0;else{var t=e.animation!==null&&e.animation===e.resizeAnimation;if(e.animation&&!t){var n=e.state.scale,r=e.setup,i=r.minScale,a=r.maxScale;if(n<i||n>a){e.isResizeAlignmentPending=!0;return}g(e)}var o=it(e);o?t||(e.setup.autoAlignment.animationTime===0?e.setState(o.scale,o.positionX,o.positionY):ot(e)):t&&at(e)}}function ct(e){var t=e.wrapperComponent,n=e.contentComponent;if(t&&n){var r=et(t,n);tt(e.measuredSizes,r)&&(e.measuredSizes=r,st(e))}}var lt=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,a=n.touchPadDisabled,o=n.excluded,s=e.isInitialized,c=e.isPanning,l=t.target;return!(!s||c||r||!l||t.deltaY===0||i&&!t.ctrlKey||a&&t.ctrlKey||J(l,o)||!e.isPressingKeys(e.setup.wheel.activationKeys))},ut=function(e,t){var n=e.setup,r=n.disabled,i=n.trackPadPanning,a=i.activationKeys,o=i.excluded;if(!e.wrapperComponent||!e.contentComponent||r||i.disabled||t.ctrlKey||lt(e,t))return!1;var s=t.target;return!(J(s,o)||!e.isPressingKeys(a))},dt=function(e){return e?e.deltaY<0?1:-1:0};function ft(e,t){return f(t,dt(e))}function pt(e,t,n){var r=t.getBoundingClientRect(),i=0,a=0;if(`clientX`in e)i=(e.clientX-r.left)/n,a=(e.clientY-r.top)/n;else{var o=e.touches[0];i=(o.clientX-r.left)/n,a=(o.clientY-r.top)/n}return Number.isNaN(i)||Number.isNaN(a)?(console.error(`No mouse or touch offset found`),{x:0,y:0}):{x:i,y:a}}var mt=function(e,t,n,r,i){var a=e.state.scale,o=e.wrapperComponent,s=e.setup,c=s.maxScale,l=s.minScale,u=s.zoomAnimation,d=s.disablePadding,f=u.size,p=u.disabled;if(!o)throw Error(`Wrapper is not mounted`);var m=a+t*n;return i?m:O(m,l,c,f,!r&&!p&&!d)},ht=function(e,t){var n=e.previousWheelEvent,r=e.state.scale,i=e.setup,a=i.maxScale,o=i.minScale;return n?r<a||r>o||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},gt=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,a=e.isInitialized,o=t.target;return!(!(a&&!r&&o)||J(o,i))},_t=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||r===null)},vt=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,a=i[0].clientX-r.left,o=i[0].clientY-r.top,s=i[1].clientX-r.left,c=i[1].clientY-r.top;return{x:(a+s)/2/t,y:(o+c)/2/t}},yt=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)**2+(e.touches[0].pageY-e.touches[1].pageY)**2)},bt=5,xt=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,a=i.maxScale,o=i.minScale,s=i.zoomAnimation,c=i.disablePadding,l=i.pinch,u=s.size,f=s.disabled,p=l.step;if(!n||r===null)throw Error(`Pinch touches distance was not provided`);if(t<0)return e.state.scale;var m=n+(t/r*n-n)*(p/bt);return O(m===1/0?0:d(m,10),o,a,u,!f&&!c)},St=160,Ct=100,wt=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;g(e),e.wheelStopEventTimer||(p(W(e),t,r),p(W(e),t,i))},Tt=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,a=e.contentComponent,o=e.setup,s=e.state.scale,c=o.limitToBounds,l=o.centerZoomedOut,u=o.zoomAnimation,d=o.wheel,f=o.disablePadding,m=o.smooth,h=u.size,g=u.disabled,_=d.step;if(!a)throw Error(`Component not mounted`);t.cancelable&&t.preventDefault(),t.stopPropagation();var v=mt(e,ft(t,null),m?_*Math.abs(t.deltaY):_,!t.ctrlKey);if(s!==v){var y=w(e,v),b=pt(t,a,s),x=c&&(g||h===0||l||f),S=E(e,b.x,b.y,v,y,x),C=S.x,T=S.y;e.previousWheelEvent=t,e.setState(v,C,T),p(W(e),t,r),p(W(e),t,i)}},Et=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;X(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(me(e,t.x,t.y),e.wheelAnimationTimer=null,e.flushResizeAlignment())},Ct),ht(e,t)&&(X(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,p(W(e),t,r),p(W(e),t,i),e.flushResizeAlignment())},St))},Dt=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onPanningStart;g(e),e.wheelStopEventTimer||(e.wheelAnimationTimer||w(e,e.state.scale),p(W(e),t,r),p(W(e),t,i))},Ot=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onPanningStop;X(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(me(e,t.x,t.y),e.wheelAnimationTimer=null,e.flushResizeAlignment())},Ct),ht(e,t)&&(X(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,p(W(e),t,r),p(W(e),t,i),e.flushResizeAlignment())},St))},kt=function(e){for(var t=0,n=0,r=0;r<2;r+=1)t+=e.touches[r].clientX,n+=e.touches[r].clientY;return{x:t/2,y:n/2}},At=function(e,t){var n=yt(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.state.scale,e.isPanning=!1,e.isPinching=!0,e.pinchPreviousCenter=kt(t),g(e)},jt=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.wrapperComponent,a=e.pinchPreviousCenter,o=e.state.scale,s=e.setup,c=s.limitToBounds,l=s.centerZoomedOut,u=s.zoomAnimation,d=s.autoAlignment,f=s.pinch,p=s.panning,m=u.disabled,h=u.size,g=f.allowPanning;if(r!==null&&n){var _=vt(t,o,n);if(Number.isFinite(_.x)&&Number.isFinite(_.y)){var v=yt(t),y=xt(e,v),b=kt(t),x=o/y,S=(b.x-(a?.x||0))*x,C=(b.y-(a?.y||0))*x;if(y!==o||S!==0||C!==0){e.pinchPreviousCenter=b;var D=w(e,y),O=c&&(m||h===0||l),k=E(e,_.x,_.y,y,D,O),A=k.x,j=k.y;if(e.pinchMidpoint=_,e.lastDistance=v,p.disabled||!g)e.setState(y,A,j);else{var ee=d.sizeX,te=d.sizeY,M=N(e,ee,y),ne=N(e,te,y),P=T(A+S,j+C,D,c,M,ne,i),re=P.x,ie=P.y;e.setState(y,re,ie)}}}}},Mt=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,e.isPinching=!1,me(e,t?.x,t?.y)},Nt=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;X(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,e.mounted&&p(W(e),t,n)},r)},Pt=function(e,t){var n=e.props,r=n.onZoomStart,i=n.onZoom,a=e.setup.doubleClick,o=a.animationTime,s=a.animationType;p(W(e),t,r),xe(e,o,s,function(){return p(W(e),t,i)}),Nt(e,t)};function Ft(e,t){return e===`toggle`?t===1?1:-1:e===`zoomOut`?-1:1}function It(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,i=e.state,a=e.contentComponent,o=i.scale,s=e.props,c=s.onZoomStart,l=s.onZoom,u=n.doubleClick,d=u.disabled,f=u.mode,m=u.step,h=u.animationTime,g=u.animationType;if(!d&&!r){if(f===`reset`)return Pt(e,t);if(!a)return console.error(`No ContentComponent found`);var _=ve(e,Ft(f,e.state.scale),m);if(o!==_){p(W(e),t,c);var v=pt(t,a,o),b=I(e,_,v.x,v.y);if(!b)return console.error(`Error during zoom event. New transformation state was not calculated.`);p(W(e),t,l),y(e,b,h,g),Nt(e,t)}}}var Lt=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,a=r.doubleClick,o=a.disabled,s=a.excluded,c=t.target,l=i?.contains(c);return!(!(n&&c&&l&&!o)||J(c,s)||Y(c))},Rt=function(){function e(e){var t=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.onTransformCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.panStartPosition=null,this.lastTouch=null,this.isPinching=!1,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.pinchPreviousCenter=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.isAnimating=!1,this.animation=null,this.animationFrame=null,this.animationResolve=null,this.initObserverTimer=null,this.isInitialLayoutPending=!1,this.measuredSizes=null,this.isResizeAlignmentPending=!1,this.resizeAnimation=null,this.pressedKeys={},this.selectionLock=null,this.mount=function(){t.mounted=!0,t.initializeWindowEvents()},this.unmount=function(){t.mounted=!1,t.cleanupWindowEvents()},this.update=function(e){t.props=e,t.setup=_e(e),t.wrapperComponent&&t.contentComponent&&!rt(t)&&w(t,t.state.scale)},this.clearTimers=function(){t.wheelStopEventTimer&&clearTimeout(t.wheelStopEventTimer),t.wheelAnimationTimer&&clearTimeout(t.wheelAnimationTimer),t.doubleClickStopEventTimer&&clearTimeout(t.doubleClickStopEventTimer),t.initObserverTimer&&clearTimeout(t.initObserverTimer),t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.doubleClickStopEventTimer=null,t.initObserverTimer=null},this.initializeWindowEvents=function(){var e,n,r,i=K(),a=t.wrapperComponent?.ownerDocument,o=a?.defaultView;(e=t.wrapperComponent)==null||e.addEventListener(`wheel`,t.onWheelPanning,i),(n=t.wrapperComponent)==null||n.addEventListener(`keyup`,t.setKeyUnPressed,i),(r=t.wrapperComponent)==null||r.addEventListener(`keydown`,t.setKeyPressed,i),o?.addEventListener(`mousedown`,t.onPanningStart,i),o?.addEventListener(`mousemove`,t.onPanning,i),o?.addEventListener(`mouseup`,t.onPanningStop,i),a?.addEventListener(`mouseleave`,t.clearPanning,i),o?.addEventListener(`keyup`,t.setKeyUnPressed,i),o?.addEventListener(`keydown`,t.setKeyPressed,i),o?.addEventListener(`blur`,t.handleWindowBlur)},this.cleanupWindowEvents=function(){var e,n,r,i,a=K(),o=t.wrapperComponent?.ownerDocument,s=o?.defaultView;s?.removeEventListener(`mousedown`,t.onPanningStart,a),s?.removeEventListener(`mousemove`,t.onPanning,a),s?.removeEventListener(`mouseup`,t.onPanningStop,a),o?.removeEventListener(`mouseleave`,t.clearPanning,a),s?.removeEventListener(`keyup`,t.setKeyUnPressed,a),s?.removeEventListener(`keydown`,t.setKeyPressed,a),s?.removeEventListener(`blur`,t.handleWindowBlur),(e=t.wrapperComponent)==null||e.removeEventListener(`wheel`,t.onWheelPanning,a),(n=t.wrapperComponent)==null||n.removeEventListener(`keyup`,t.setKeyUnPressed,a),(r=t.wrapperComponent)==null||r.removeEventListener(`keydown`,t.setKeyPressed,a),t.cleanupWrapperEvents(),t.clearTimers(),g(t),t.unlockTextSelection(),(i=t.observer)==null||i.disconnect(),t.observer=void 0,t.isInitialLayoutPending=!1,t.isResizeAlignmentPending=!1,t.resizeAnimation=null},this.cleanupWrapperEvents=function(){var e=t.wrapperComponent;if(e){var n=K();e.removeEventListener(`wheel`,t.onWheelZoom,n),e.removeEventListener(`dblclick`,t.onDoubleClick,n),e.removeEventListener(`keydown`,t.onKeyboardNavigation,n),e.removeEventListener(`touchstart`,t.onTouchPanningStart,n),e.removeEventListener(`touchmove`,t.onTouchPanning,n),e.removeEventListener(`touchend`,t.onTouchPanningStop,n)}},this.handleInitializeWrapperEvents=function(e){var n=K();e.addEventListener(`wheel`,t.onWheelZoom,n),e.addEventListener(`dblclick`,t.onDoubleClick,n),e.addEventListener(`keydown`,t.onKeyboardNavigation,n),e.addEventListener(`touchstart`,t.onTouchPanningStart,n),e.addEventListener(`touchmove`,t.onTouchPanning,n),e.addEventListener(`touchend`,t.onTouchPanningStop,n)},this.handleInitialize=function(){var e=t.setup,n=e.centerOnInit,r=e.fitOnInit;if(t.applyTransformation(),t.onInitCallbacks.forEach(function(e){return e(W(t))}),n||r){var i=t.applyInitialLayout();t.isInitialLayoutPending=!0,t.initObserverTimer&&clearTimeout(t.initObserverTimer),i&&(t.initObserverTimer=setTimeout(function(){t.initObserverTimer=null,t.isInitialLayoutPending=!1},5e3))}},this.observeSizes=function(e,n){var r;(r=t.observer)==null||r.disconnect(),t.observer=void 0,t.measuredSizes=et(e,n),typeof ResizeObserver<`u`&&(t.observer=new ResizeObserver(t.onSizeChange),t.observer.observe(e),t.observer.observe(n))},this.onSizeChange=function(){var e=t,n=e.wrapperComponent,r=e.contentComponent;if(t.mounted&&n&&r){if(t.isInitialLayoutPending){if(!((r.offsetWidth>0||r.offsetHeight>0)&&n.clientWidth>0&&n.clientHeight>0))return;t.isInitialLayoutPending=!1,t.initObserverTimer&&clearTimeout(t.initObserverTimer),t.initObserverTimer=null,t.onInitCallbacks.forEach(function(e){return e(W(t))}),t.applyInitialLayout(),t.measuredSizes=et(n,r),w(t,t.state.scale)}else ct(t)}},this.flushResizeAlignment=function(){t.isResizeAlignmentPending&&(t.isResizeAlignmentPending=!1,st(t))},this.onWheelZoom=function(e){t.setup.disabled||(t.syncModifierKeys(e),lt(t,e)&&(wt(t,e),Tt(t,e),Et(t,e)))},this.onWheelPanning=function(e){var n=t.props.onPanning,r=t.setup.trackPadPanning,i=r.lockAxisX,a=r.lockAxisY;if(t.syncModifierKeys(e),ut(t,e)){e.cancelable&&e.preventDefault(),e.stopPropagation();var o=t.state,s=o.positionX,c=o.positionY,l=s-e.deltaX,u=c-e.deltaY,d=i?s:l,f=a?c:u,m=t.setup.autoAlignment,h=m.sizeX,g=m.sizeY,_=N(t,h),v=N(t,g);(d!==s||f!==c)&&(Dt(t,e),M(t,d,f,_,v),p(W(t),e,n),Ot(t,e))}},this.onPanningStart=function(e){var n=t.setup,r=n.disabled,i=n.panning,a=t.props.onPanningStart;r||i.disabled||(t.syncModifierKeys(e),k(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.button!==0||t.setup.panning.allowLeftClickPan)&&(e.button!==1||t.setup.panning.allowMiddleClickPan)&&(e.button!==2||t.setup.panning.allowRightClickPan)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),g(t),ue(t,e),t.lockTextSelection(),t.focusForKeyboard(),p(W(t),e,a)))},this.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||(t.syncModifierKeys(e),t.isPanning&&e.buttons===0?t.clearPanning(e):A(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),fe(t,e.clientX,e.clientY,P.MOUSE),p(W(t),e,r)))},this.onPanningStop=function(e){var n=t.setup.panning.velocityDisabled,r=t.props.onPanningStop;t.isPanning&&(t.unlockTextSelection(),pe(t,n),p(W(t),e,r),t.flushResizeAlignment())},this.onPinchStart=function(e){var n=t.setup.disabled,r=t.props.onPinchStart;n||gt(t,e)&&(At(t,e),g(t),p(W(t),e,r))},this.onPinch=function(e){var n=t.setup.disabled,r=t.props.onPinch;n||_t(t)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),jt(t,e),p(W(t),e,r))},this.onPinchStop=function(e){var n=t.props.onPinchStop;t.pinchStartScale&&(Mt(t),p(W(t),e,n),t.flushResizeAlignment())},this.onTouchPanningStart=function(e){var n=t.setup,r=n.disabled,i=n.doubleClick,a=t.props.onPanningStart;if(!r){var o=!i?.disabled,s=t.lastTouch&&+new Date-t.lastTouch<200;if(o&&s&&e.touches.length===1)t.lastTouch=null,t.onDoubleClick(e);else{t.lastTouch=+new Date,g(t);var c=e.touches,l=c.length===1,u=c.length===2,d=k(t,e);if(l){if(!d||t.setup.panning.disabled)return;g(t),ue(t,e),t.lockTextSelection(),t.focusForKeyboard(),p(W(t),e,a)}u&&t.onPinchStart(e)}}},this.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&e.touches.length===1){if(n||!A(t))return;e.cancelable&&e.preventDefault(),e.stopPropagation();var i=e.touches[0];fe(t,i.clientX,i.clientY,P.TOUCH),p(W(t),e,r)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){t.setup.disabled||Lt(t,e)&&It(t,e)},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.handleWindowBlur=function(){t.pressedKeys={},t.isPanning&&(t.isPanning=!1,t.startCoords=null),t.unlockTextSelection(),t.flushResizeAlignment()},this.syncModifierKeys=function(e){var n=e.ctrlKey,r=e.metaKey,i=e.shiftKey,a=e.altKey;typeof n==`boolean`&&(t.pressedKeys.Control=n),typeof r==`boolean`&&(t.pressedKeys.Meta=r),typeof i==`boolean`&&(t.pressedKeys.Shift=i),typeof a==`boolean`&&(t.pressedKeys.Alt=a)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return typeof e==`function`?e(Object.entries(t.pressedKeys).filter(function(e){return e[1]}).map(function(e){return e[0]})):!e.length||!!e.every(function(e){return t.pressedKeys[e]})},this.onKeyboardNavigation=function(e){$e(t,e)},this.focusForKeyboard=function(){var e=t.wrapperComponent;if(e&&!t.setup.keyboard.disabled){var n=e.ownerDocument?.activeElement;n&&e.contains(n)||typeof e.focus==`function`&&e.focus({preventScroll:!0})}},this.lockTextSelection=function(){var e=t.wrapperComponent;e&&!t.selectionLock&&(t.selectionLock={userSelect:e.style.userSelect,webkitUserSelect:e.style.webkitUserSelect},e.style.userSelect=`none`,e.style.webkitUserSelect=`none`)},this.unlockTextSelection=function(){var e=t.selectionLock;t.selectionLock=null;var n=t.wrapperComponent;n&&e&&(n.style.userSelect=e.userSelect,n.style.webkitUserSelect=e.webkitUserSelect)},this.applyInitialLayout=function(){var e=t.setup.fitOnInit,n=t,r=n.wrapperComponent,i=n.contentComponent,a=!!r&&!!i&&r.clientWidth>0&&r.clientHeight>0&&(i.offsetWidth>0||i.offsetHeight>0);if(e){var o=H(t,e===`cover`?`cover`:`contain`);if(o)return t.setState(o.scale,o.positionX,o.positionY),a}return t.setCenter(),a},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Z(t.state.scale,t.wrapperComponent,t.contentComponent);t.setState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,r){return t.props.customTransform?t.props.customTransform(e,n,r):qe(e,n,r)},this.getContext=function(){return W(t)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.state,n=e.scale,r=e.positionX,i=e.positionY,a=t.handleTransformStyles(r,i,n);t.props.detached||(t.contentComponent.style.transform=a),t.onTransformCallbacks.forEach(function(e){return e({scale:n,positionX:r,positionY:i,previousScale:t.state.previousScale,ref:W(t)})})}},this.setState=function(e,n,r){var i=t.props.onTransform;if(!Number.isNaN(e)&&!Number.isNaN(n)&&!Number.isNaN(r)){var a=Math.max(e,1e-7);a!==t.state.scale&&(t.state.previousScale=t.state.scale,t.state.scale=a),t.state.positionX=n,t.state.positionY=r,t.applyTransformation();var o=W(t);t.onChangeCallbacks.forEach(function(e){return e(o)}),p(o,{scale:t.state.scale,positionX:n,positionY:r},i)}else console.error(`Detected NaN set state values`)},this.onTransform=function(e){return t.onTransformCallbacks.has(e)||t.onTransformCallbacks.add(e),function(){t.onTransformCallbacks.delete(e)}},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.mounted=!0,t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,w(t,t.state.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.observeSizes(e,n),t.initializeWindowEvents(),t.isInitialized=!0;var r=W(t);p(r,void 0,t.props.onInit),Je(t.props.ref,r)},this.props=e,this.setup=_e(this.props),this.state=ge(this.props)}return e}(),Q=l.createContext(null),zt=function(e,t){return typeof e==`function`?e(t):e},Bt=l.forwardRef(function(e,t){var n=(0,l.useRef)(null);n.current===null&&(n.current=new Rt(e));var r=n.current,i=zt(e.children,U(r));return(0,l.useImperativeHandle)(t,function(){return U(r)},[r]),(0,l.useEffect)(function(){return r.mount(),function(){r.unmount()}},[r]),(0,l.useEffect)(function(){r.update(e)},[r,e]),(0,u.jsx)(Q.Provider,L({value:r},{children:i}))});l.forwardRef(function(e,t){var n=(0,l.useRef)(null),r=(0,l.useContext)(Q);return Xe(function(){var e=function(e){if(n.current){var t=0,i=0;n.current.style.transform=r.handleTransformStyles(t,i,1/e)}};return e(r.state.scale),r.onChange(function(t){e(t.instance.state.scale)})},[r]),(0,u.jsx)(`div`,L({},e,{ref:Ye([n,t])}))});function Vt(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Ht=`.transform-component-module_wrapper__SPB86 {
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{t}from"./MinusSignIcon-DGIm2EHe.js";import{c as n,t as r}from"./tooltip-CVA2QYzo.js";import{a as i,t as a}from"./button-CWFREsRn.js";import{c as o,l as s}from"./utils-U6QfaJBO.js";var c=[[`path`,{d:`M9.13432 2.5C6.46805 2.56075 4.9107 2.81456 3.84664 3.87493C2.91537 4.80297 2.60406 6.10756 2.5 8.2M14.8657 2.5C17.532 2.56075 19.0893 2.81456 20.1534 3.87493C21.0846 4.80297 21.3959 6.10756 21.5 8.2M14.8657 21.5C17.532 21.4392 19.0893 21.1854 20.1534 20.1251C21.0846 19.197 21.3959 17.8924 21.5 15.8M9.13432 21.5C6.46805 21.4392 4.9107 21.1854 3.84664 20.1251C2.91537 19.197 2.60406 17.8924 2.5 15.8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],l=e(s()),u=o(),d=function(e,t){return Number(e.toFixed(t))},f=function(e,t){return typeof e==`number`?e:t},p=function(e,t,n){n&&typeof n==`function`&&n(e,t)},m={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},h=function(e){var t=e.animationResolve;e.animationResolve=null,t?.()},g=function(e){e.animationFrame!==null&&cancelAnimationFrame(e.animationFrame),e.animationFrame=null,e.isAnimating=!1,e.animation=null,e.velocity=null,h(e)};function _(e,t,n,r,i){if(!e.mounted)i?.();else{var a=new Date().getTime(),o=1;g(e);var s=function(){if(e.mounted&&e.animation===s){var i=new Date().getTime()-a,c=i/n,l=m[t],u=l(c);if(i>=n){e.animation=null,e.animationFrame=null;var d=e.animationResolve;e.animationResolve=null,r(o),d?.(),e.flushResizeAlignment()}else r(u),e.animationFrame=requestAnimationFrame(s)}};e.animation=s,e.animationResolve=i??null,e.animationFrame=requestAnimationFrame(s)}}function v(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function y(e,t,n,r){var i=v(t);if(!e.mounted||!i)return Promise.resolve();var a=e.setState,o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=t.scale-s,d=t.positionX-c,f=t.positionY-l;return n===0?(a(t.scale,t.positionX,t.positionY),Promise.resolve()):new Promise(function(t){_(e,r,n,function(t){e.isAnimating=t!==1,a(s+u*t,c+d*t,l+f*t)},t)})}function b(e,t,n){var r=e.clientWidth,i=e.clientHeight,a=t.offsetWidth,o=t.offsetHeight,s=a*n,c=o*n;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:r-s,newContentHeight:c,newDiffHeight:i-c}}var x=function(e,t,n,r,i,a,o){var s=e>t?n*(o?.5:1):0,c=r>i?a*(o?.5:1):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-i-c,maxPositionY:c,scaleWidthFactor:s,scaleHeightFactor:c}},S=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup,a=i.centerZoomedOut,o=i.disablePadding;if(!n||!r)throw Error(`Components are not mounted`);var s=b(n,r,t),c=s.wrapperWidth,l=s.wrapperHeight,u=s.newContentWidth,d=s.newContentHeight,f=s.newDiffWidth,p=s.newDiffHeight,m=x(c,u,f,l,d,p,!!a);o&&c>=u&&l>=d&&!a&&(m.minPositionX=0,m.maxPositionX=0,m.minPositionY=0,m.maxPositionY=0);var h=e.setup,g=h.minPositionX,_=h.maxPositionX,v=h.minPositionY,y=h.maxPositionY;return g!=null&&(m.minPositionX=c*(1-t)+g*t),_!=null&&(m.maxPositionX=_*t),v!=null&&(m.minPositionY=l*(1-t)+v*t),y!=null&&(m.maxPositionY=y*t),m},C=function(e,t,n,r){return d(r?e<t?t:e>n?n:e:e,2)},w=function(e,t){var n=S(e,t);return e.bounds=n,n};function T(e,t,n,r,i,a,o){var s=n.minPositionX,c=n.minPositionY,l=n.maxPositionX,u=n.maxPositionY,d=0,f=0;return o&&(d=i,f=a),{x:C(e,s-d,l+d,r),y:C(t,c-f,u+f,r)}}function E(e,t,n,r,i,a){var o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=r-s;return!Number.isFinite(t)||!Number.isFinite(n)?(console.error(`Mouse X and Y position were not provided!`),{x:c,y:l}):T(c-t*u,l-n*u,i,a,0,0,null)}var D=1e-7;function O(e,t,n,r,i){var a=i?r:0,o=Math.max(t-a,D),s=n+a;return!Number.isNaN(n)&&e>=s?s:!Number.isNaN(t)&&e<=o?o:Math.max(e,D)}var k=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,a=t.target,o=function(e){return!!e&&typeof e==`object`&&e.nodeType===1&&typeof e.contains==`function`},s=typeof t.composedPath==`function`?t.composedPath().some(function(e){return o(e)&&!!i?.contains(e)}):!!i?.contains(a);return!(!(r&&a&&s)||J(a,n)||Ge(a)||Y(a))},A=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!!(t&&n&&!r)},j=function(e,t){var n=e.state,r=n.positionX,i=n.positionY;e.isPanning=!0;var a=t.clientX,o=t.clientY;e.startCoords={x:a-r,y:o-i}},ee=function(e,t){var n=t.touches,r=e.state,i=r.positionX,a=r.positionY;if(e.isPanning=!0,n.length===1){var o=n[0].clientX,s=n[0].clientY;e.startCoords={x:o-i,y:s-a}}};function te(e){var t=e.state,n=t.positionX,r=t.positionY,i=t.scale,a=e.setup,o=a.disabled,s=a.limitToBounds,c=a.centerZoomedOut,l=e.wrapperComponent;if(!o&&l&&e.bounds){var u=e.bounds,d=u.maxPositionX,f=u.minPositionX,p=u.maxPositionY,m=u.minPositionY,h=n>d||n<f,g=r>p||r<m,_=E(e,n>d?l.clientWidth:e.setup.minPositionX||0,r>p?l.clientHeight:e.setup.minPositionY||0,i,e.bounds,s||c),v=_.x,y=_.y;return{scale:i,positionX:h?v:n,positionY:g?y:r}}}function M(e,t,n,r,i){var a=e.setup.limitToBounds,o=e.wrapperComponent,s=e.bounds,c=e.state,l=c.scale,u=c.positionX,d=c.positionY;if(!(o===null||s===null||t===u&&n===d)){var f=T(t,n,s,a,r,i,o),p=f.x,m=f.y;e.setState(l,p,m)}}var ne=function(e,t,n){var r=e.startCoords,i=e.state,a=e.setup.panning,o=a.lockAxisX,s=a.lockAxisY,c=i.positionX,l=i.positionY;if(!r)return{x:c,y:l};var u=t-r.x,d=n-r.y;return{x:o?c:u,y:s?l:d}},N=function(e,t,n){var r=e.setup,i=e.state,a=r.minScale,o=r.disablePadding,s=r.centerZoomedOut,c=n??i.scale;return t>0&&c>=a&&!o&&!s?t:0},P;(function(e){e.TRACK_PAD=`track_pad`,e.MOUSE=`mouse`,e.TOUCH=`touch`})(P||={});var re=function(e){var t=e.mounted,n=e.wrapperComponent,r=e.contentComponent,i=e.setup,a=i.disabled,o=i.velocityAnimation,s=i.limitToBounds,c=e.state.scale;return o.disabled||a||!t||!n||!r?!1:!s||n.clientWidth<r.offsetWidth*c||n.clientHeight<r.offsetHeight*c},ie=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,a=i.disabled;return!(i.velocityAnimation.disabled||a||!t||!n||!r)};function ae(e,t){var n=e.setup.velocityAnimation,r=n.animationTime,i=n.maxAnimationTime,a=n.inertia;return Math.min(r*Math.max(1,Math.abs(t/a)),i)}function oe(e,t,n,r,i,a,o,s,c,l){if(i){if(t>o&&n>o){var u=o+(e-o)*l;return u>c?c:u<o?o:u}if(t<a&&n<a){var u=a+(e-a)*l;return u<s?s:u>a?a:u}}return r?t:C(e,a,o,i)}function se(e){var t=1,n=e.clientWidth/window.innerWidth;return Number.isNaN(n)?t:Math.min(t,n)}var F=function(e,t,n){var r=0,i=e*n;return Number.isNaN(i)?r:e<0?Math.max(i,-t):Math.min(i,t)};function ce(e,t,n){var r,i;if(re(e)){var a=e.lastMousePosition,o=e.velocityTime,s=e.setup,c=e.wrapperComponent,l=s.velocityAnimation,u=l.maxStrengthMouse,d=l.maxStrengthTouch,f=l.sensitivityTouch,p=l.sensitivityMouse,m=Date.now();if(a&&o&&c){var h=se(c),g=(r={},r[P.TOUCH]=f,r[P.MOUSE]=p,r)[n],_=(i={},i[P.TOUCH]=d,i[P.MOUSE]=u,i)[n],v=t.x-a.x,y=t.y-a.y,b=F(v/h,_,g),x=F(y/h,_,g),S=m-o,C=v*v+y*y;e.velocity={velocityX:b,velocityY:x,total:F(Math.sqrt(C)/S,_,g)}}e.lastMousePosition=t,e.velocityTime=m}}function le(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent;if(ie(e)&&t&&n&&i){var a=t.velocityX,o=t.velocityY,s=t.total,c=n.maxPositionX,l=n.minPositionX,u=n.maxPositionY,d=n.minPositionY,f=r.limitToBounds,p=r.autoAlignment,h=r.zoomAnimation,g=r.panning,v=g.lockAxisY,y=g.lockAxisX,b=h.animationType,x=p.sizeX,S=p.sizeY,C=p.velocityAlignmentTime,w=ae(e,s),T=Math.max(w,C),E=N(e,x),D=N(e,S),O=E*i.clientWidth/100,k=D*i.clientHeight/100,A=c+O,j=l-O,ee=u+k,te=d-k,M=e.state,ne=new Date().getTime();_(e,b,T,function(t){var n=e.state,r=n.scale,i=n.positionX,s=n.positionY,h=(new Date().getTime()-ne)/C,g=m[p.animationType],_=1-g(Math.min(1,h)),b=1-t,x=i+a*b,S=s+o*b,w=oe(x,M.positionX,i,y,f,l,c,j,A,_),T=oe(S,M.positionY,s,v,f,d,u,te,ee,_);if(i!==x||s!==S){e.setState(r,w,T);var E=e.props.onPanning;E&&E(W(e),{})}})}}function ue(e,t){var n=e.state,r=n.scale;e.panStartPosition={x:n.positionX,y:n.positionY},g(e),w(e,r),`touches`in t?ee(e,t):j(e,t)}function de(e,t){var n=e.state.scale,r=e.setup,i=r.minScale,a=r.autoAlignment,o=a.disabled,s=a.sizeX,c=a.sizeY,l=a.animationTime,u=a.animationType;if(!(o||n<i||!s&&!c)){e.isResizeAlignmentPending&&w(e,n);var d=te(e);if(d){var f=e.state,p=f.positionX,m=f.positionY;(d.positionX!==p||d.positionY!==m)&&y(e,d,t??l,u)}}}function fe(e,t,n,r){var i=e.startCoords,a=e.setup.autoAlignment,o=a.sizeX,s=a.sizeY;if(i){var c=ne(e,t,n),l=c.x,u=c.y,d=N(e,o),f=N(e,s);ce(e,{x:l,y:u},r),M(e,l,u,d,f)}}function pe(e,t){if(e.isPanning){var n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1;var a=e.state,o=a.positionX,s=a.positionY,c=a.scale,l=e.panStartPosition;if(e.panStartPosition=null,l){var u=o-l.x,d=s-l.y;if(u*u+d*d<=25)return}e.isAnimating=!1,e.animation=null,e.isResizeAlignmentPending&&w(e,c);var f=r?.clientWidth||0,p=r?.clientHeight||0,m=(i?.offsetWidth||0)*c,h=(i?.offsetHeight||0)*c,g=!e.setup.limitToBounds||f<m||p<h;!t&&n&&n.total>.1&&g?le(e):de(e)}}function I(e,t,n,r){var i=e.setup,a=i.minScale,o=i.maxScale,s=i.limitToBounds,c=O(d(t,2),a,o,0,!1),l=E(e,n,r,c,w(e,c),s);return{scale:c,positionX:l.x,positionY:l.y}}function me(e,t,n){var r=e.state.scale,i=e.wrapperComponent,a=e.setup,o=a.minScale,s=a.maxScale,c=a.limitToBounds,l=a.zoomAnimation,u=l.disabled,d=l.animationTime,f=l.animationType,p=u||r>=o&&r<=s;if((r>=1||c)&&de(e),!p&&i&&e.mounted){var m=t||i.clientWidth/2,h=n||i.clientHeight/2,g=I(e,r<o?o:s,m,h);g&&y(e,g,d,f)}}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function he(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var R={previousScale:1,scale:1,positionX:0,positionY:0},z={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,fitOnInit:!1,disablePadding:!1,smooth:!0,detached:!1,wheel:{step:.015,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},trackPadPanning:{disabled:!0,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,allowPanning:!0,excluded:[]},keyboard:{disabled:!0,panStep:50,zoomStep:.25,animationTime:100,animationType:`easeOut`,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:`zoomIn`,animationType:`easeOut`,animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:`easeOut`},autoAlignment:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:`easeOut`},velocityAnimation:{disabled:!1,sensitivityMouse:1,sensitivityTouch:1.2,maxStrengthMouse:20,maxStrengthTouch:40,inertia:1,animationTime:300,maxAnimationTime:800,animationType:`easeOut`}},B={wrapperClass:`react-transform-wrapper`,contentClass:`react-transform-component`},ge=function(e){var t=Math.max(e.minScale??z.minScale,1e-7),n=e.maxScale??z.maxScale,r=e.initialScale??R.scale,i=Math.min(Math.max(r,t),n);return{previousScale:i,scale:i,positionX:C(e.initialPositionX??R.positionX,e.minPositionX??-1/0,e.maxPositionX??1/0,e.minPositionX!=null||e.maxPositionX!=null),positionY:C(e.initialPositionY??R.positionY,e.minPositionY??-1/0,e.maxPositionY??1/0,e.minPositionY!=null||e.maxPositionY!=null)}},_e=function(e){var t=L({},z);return Object.keys(e).forEach(function(n){var r=n,i=e[r]!==void 0;if(z[r]!==void 0&&i){var a=Object.prototype.toString.call(z[r]);t[r]=a===`[object Object]`?L(L({},z[r]),e[r]):a===`[object Array]`?he(he([],z[r],!0),e[r],!0):e[r]}}),t.minScale<=0&&(t.minScale=1e-7),t},ve=function(e,t,n){var r=e.state.scale,i=e.wrapperComponent,a=e.setup,o=a.maxScale,s=a.minScale,c=a.zoomAnimation.size;if(!i)throw Error(`Wrapper is not mounted`);return O(d(r+t*n,3),s,o,c,!1)};function V(e,t,n,r){var i=e.wrapperComponent,a=e.props,o=a.onZoomStart,s=a.onZoom,c=a.onZoomStop,l=new MouseEvent(`mousemove`,{bubbles:!0}),u=W(e);p(u,l,o),p(u,l,s);var d=y(e,t,n,r),f=i?.ownerDocument?.defaultView??(typeof window<`u`?window:null);return f&&f.setTimeout(function(){e.mounted&&p(W(e),l,c)},n),d}function ye(e,t,n,r,i){var a=e.wrapperComponent,o=e.state,s=o.scale,c=o.positionX,l=o.positionY,u=e.setup.zoomAnimation;if(!a)return console.error(`No WrapperComponent found`),Promise.resolve();var d=u.disabled?0:r,f=a.clientWidth,p=a.clientHeight,m=(f/2-c)/s,h=(p/2-l)/s,g=I(e,ve(e,t,n),m,h);return g?V(e,g,d,i):(console.error(`Error during zoom event. New transformation state was not calculated.`),Promise.resolve())}function be(e,t,n,r){var i=e.wrapperComponent,a=e.props,o=a.onPanningStart,s=a.onPanning,c=a.onPanningStop,l=new MouseEvent(`mousemove`,{bubbles:!0}),u=W(e);p(u,l,o),p(u,l,s);var d=y(e,t,n,r),f=i?.ownerDocument?.defaultView??(typeof window<`u`?window:null);return f&&f.setTimeout(function(){e.mounted&&p(W(e),l,c)},n),d}function H(e,t,n,r){t===void 0&&(t=`contain`);var i=e.wrapperComponent,a=e.contentComponent,o=e.setup;if(!i||!a)return null;var s=a.offsetWidth,c=a.offsetHeight,l=i.clientWidth,u=i.clientHeight;if(!s||!c||!l||!u)return null;var d=l/s,f=u/c,p=t===`cover`?Math.max(d,f):Math.min(d,f);return r!==void 0&&(p=Math.min(p,r)),n!==void 0&&(p=Math.max(p,n)),p=O(p,o.minScale,o.maxScale,0,!1),Z(p,i,a)}function xe(e,t,n,r){var i=e.setup,a=e.wrapperComponent,o=e.contentComponent,s=i.limitToBounds,c=i.centerOnInit,l=i.fitOnInit,u=ge(e.props),d=e.state,f=d.scale,p=d.positionX,m=d.positionY;if(!a)return Promise.resolve();if(l){var h=H(e,l===`cover`?`cover`:`contain`);if(h)return f===h.scale&&p===h.positionX&&m===h.positionY?Promise.resolve():(r?.(),V(e,h,t,n))}var g=u.positionX,_=u.positionY;if(c&&o){var v=Z(u.scale,a,o);g=v.positionX,_=v.positionY}var y=S(e,u.scale),b=T(g,_,y,s,0,0,a),x={scale:u.scale,positionX:b.x,positionY:b.y};return f===u.scale&&p===u.positionX&&m===u.positionY?Promise.resolve():(r?.(),V(e,x,t,n))}var Se=function(e){if(`getBoundingClientRect`in e){var t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}return e};function Ce(e){var t=e.map(Se),n=Math.min.apply(Math,t.map(function(e){return e.x})),r=Math.min.apply(Math,t.map(function(e){return e.y})),i=Math.max.apply(Math,t.map(function(e){return e.x+e.width})),a=Math.max.apply(Math,t.map(function(e){return e.y+e.height}));return{x:n,y:r,width:i-n,height:a-r}}function we(e,t,n,r){var i=Se(e),a=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=a.x*r.scale,c=a.y*r.scale;return{x:(i.x-o.x+s)/r.scale,y:(i.y-o.y+c)/r.scale}}function Te(e,t,n,r,i,a,o){r===void 0&&(r=0),i===void 0&&(i=0);var s=e.wrapperComponent,c=e.contentComponent,l=e.state,u=e.setup,d=u.limitToBounds,f=u.minScale,p=u.maxScale;if(!s||!c)return l;var m=s.getBoundingClientRect(),h=we(t,s,c,l),g=h.x,_=h.y,v=t.width/l.scale,y=t.height/l.scale,b=s.clientWidth/v,x=s.clientHeight/y,C=n||Math.min(b,x);o!==void 0&&(C=Math.min(C,o)),a!==void 0&&(C=Math.max(C,a));var w=O(C,f,p,0,!1),E=(m.width-v*w)/2,D=(m.height-y*w)/2,k=T((m.left-g)*w+E+r,(m.top-_)*w+D+i,S(e,w),d,0,0,s);return{positionX:k.x,positionY:k.y,scale:w}}function Ee(e,t,n){var r=e.wrapperComponent,i=e.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:(t-a.left-i.positionX)/i.scale,y:(n-a.top-i.positionY)/i.scale}}function De(e,t,n){var r=e.wrapperComponent,i=e.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:a.left+i.positionX+t*i.scale,y:a.top+i.positionY+n*i.scale}}var Oe=function(e){return function(t,n,r){return t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r=`easeOut`),ye(e,1,t,n,r)}},ke=function(e){return function(t,n,r){return t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r=`easeOut`),ye(e,-1,t,n,r)}},Ae=function(e){return function(t,n,r,i,a){i===void 0&&(i=300),a===void 0&&(a=`easeOut`);var o=e.state,s=o.positionX,c=o.positionY,l=o.scale,u=e.wrapperComponent,d=e.contentComponent;return e.setup.disabled||!u||!d?Promise.resolve():y(e,{positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(r)?l:r},i,a)}},je=function(e){return function(t,n){return t===void 0&&(t=200),n===void 0&&(n=`easeOut`),xe(e,t,n)}},Me=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r=`easeOut`);var i=e.state,a=e.wrapperComponent,o=e.contentComponent;return a&&o?y(e,Z(t||i.scale,a,o),n,r):Promise.resolve()}},Ne=function(e){return function(t,n,r,i,a){i===void 0&&(i=300),a===void 0&&(a=`easeOut`);var o=e.wrapperComponent,s=e.contentComponent,c=e.setup;if(c.disabled||!o||!s)return Promise.resolve();var l=Ee(e,n,r),u=I(e,t,l.x,l.y);return u?V(e,u,c.zoomAnimation.disabled?0:i,a):Promise.resolve()}},Pe=function(e){return function(t,n){return Ee(e,t,n)}},Fe=function(e){return function(t,n){return De(e,t,n)}},Ie=function(e,t){var n=e.wrapperComponent;if(!n)return[];var r=n.getRootNode(),i=r&&`getElementById`in r?r:n.ownerDocument??(typeof document<`u`?document:null);return(Array.isArray(t)?t:[t]).map(function(e){return typeof e==`string`?i?.getElementById(e):e}).filter(function(e){return!!e&&n.contains(e)})},Le=function(e){return function(t,n,r,i,a,o){r===void 0&&(r=600),i===void 0&&(i=`easeOut`),a===void 0&&(a=0),o===void 0&&(o=0),g(e);var s=typeof n==`object`&&n?n:{scale:n},c=Ie(e,t);return!e.wrapperComponent||c.length===0?Promise.resolve():y(e,Te(e,Ce(c),s.scale,s.offsetX??a,s.offsetY??o,s.minScale,s.maxScale),s.animationTime??r,s.animationType??i)}},Re=function(e){return function(t){t===void 0&&(t={});var n=e.wrapperComponent,r=e.contentComponent,i=e.setup;if(i.disabled||!n||!r)return Promise.resolve();var a=H(e,t.mode??`contain`,t.minScale,t.maxScale);return a?V(e,a,i.zoomAnimation.disabled?0:t.animationTime??200,t.animationType??`easeOut`):Promise.resolve()}},ze=function(e){return function(t,n,r,i){r===void 0&&(r=200),i===void 0&&(i=`easeOut`);var a=e.wrapperComponent,o=e.contentComponent,s=e.setup,c=e.state;if(s.disabled||!a||!o||!Number.isFinite(t)||!Number.isFinite(n))return Promise.resolve();var l=w(e,c.scale),u=T(c.positionX+t,c.positionY+n,l,s.limitToBounds,0,0,a),d=u.x,f=u.y;return d===c.positionX&&f===c.positionY?Promise.resolve():be(e,{scale:c.scale,positionX:d,positionY:f},r,i)}},U=function(e){return{instance:e,state:e.state,zoomIn:Oe(e),zoomOut:ke(e),setTransform:Ae(e),resetTransform:je(e),centerView:Me(e),zoomToElement:Le(e),zoomToPoint:Ne(e),clientToContent:Pe(e),contentToClient:Fe(e),fitToView:Re(e),panBy:ze(e)}},Be=function(e){return{instance:e,state:e.state}},W=function(e){var t={};return Object.assign(t,Be(e)),Object.assign(t,U(e)),t},G=!1;function K(){try{return{get passive(){return G=!0,!1}}}catch{return G=!1,G}}var q=`.${B.wrapperClass}`,J=function(e,t){return t.some(function(t){return e.matches(`${q} ${t}, ${q} .${t}, ${q} ${t} *, ${q} .${t} *`)})},Ve=new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`]),He=`[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]`,Ue=`[draggable="true"]`,We=function(e){return!e||typeof e.closest!=`function`?null:e},Y=function(e){var t=We(e);return t?Ve.has(t.tagName)||t.isContentEditable?!0:t.closest(He)!==null:!1},Ge=function(e){var t=We(e);return t?t.closest(Ue)!==null:!1},X=function(e){e&&clearTimeout(e)},Ke=function(e){return Number.parseFloat(e.toFixed(8))},qe=function(e,t,n){return`translate(${e}px, ${t}px) scale(${Ke(n)})`},Z=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e;return{scale:e,positionX:(t.clientWidth-r)/2,positionY:(t.clientHeight-i)/2}};function Je(e,t){e!=null&&(typeof e==`function`?e(t):e.current=t)}function Ye(e){return function(t){e.forEach(function(e){typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Xe=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ze={panLeft:[`ArrowLeft`],panRight:[`ArrowRight`],panUp:[`ArrowUp`],panDown:[`ArrowDown`],zoomIn:[`+`,`=`],zoomOut:[`-`,`_`],reset:[`0`]},Qe=function(e){return Object.values(Ze).some(function(t){return t.includes(e)})};function $e(e,t){var n=e.setup,r=n.disabled,i=n.keyboard,a=n.panning;if(r||i.disabled||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||!Qe(t.key))return!1;var o=t.target;if(Y(o)||o&&typeof o.matches==`function`&&J(o,i.excluded))return!1;var s=i.panStep,c=i.zoomStep,l=i.animationTime,u=i.animationType,d=U(e),f=t.key,p=a.lockAxisX?0:s,m=a.lockAxisY?0:s;return f===`ArrowLeft`?d.panBy(p,0,l,u):f===`ArrowRight`?d.panBy(-p,0,l,u):f===`ArrowUp`?d.panBy(0,m,l,u):f===`ArrowDown`?d.panBy(0,-m,l,u):f===`+`||f===`=`?d.zoomIn(c,l,u):f===`-`||f===`_`?d.zoomOut(c,l,u):f===`0`&&d.resetTransform(l,u),t.cancelable&&t.preventDefault(),t.stopPropagation(),!0}var et=function(e,t){return{wrapperWidth:e.offsetWidth,wrapperHeight:e.offsetHeight,contentWidth:t.offsetWidth,contentHeight:t.offsetHeight}},tt=function(e,t){return!e||e.wrapperWidth!==t.wrapperWidth||e.wrapperHeight!==t.wrapperHeight||e.contentWidth!==t.contentWidth||e.contentHeight!==t.contentHeight},nt=function(e){return e.isPanning||e.isPinching},rt=function(e){return nt(e)||e.wheelStopEventTimer!==null||e.wheelAnimationTimer!==null};function it(e){var t=e.wrapperComponent,n=e.contentComponent,r=e.setup,i=e.state;if(!t||!n)return null;var a=w(e,i.scale),o=r.limitToBounds,s=r.centerZoomedOut;if(!o&&!s)return null;var c=T(i.positionX,i.positionY,a,!0,0,0,t),l=c.x,u=c.y;return l===d(i.positionX,2)&&u===d(i.positionY,2)?null:{scale:i.scale,positionX:l,positionY:u}}var at=function(e){e.animation=null,e.animationFrame=null,e.isAnimating=!1,e.resizeAnimation=null};function ot(e){var t=e.setup.autoAlignment.animationTime,n=Math.max(t/5,1);g(e);var r=Date.now(),i=function(){if(e.mounted&&e.animation===i){var t=Date.now(),a=Math.max(t-r,1);r=t;var o=it(e);if(!o)at(e);else{var s=e.state,c=s.scale,l=s.positionX,u=s.positionY,d=1-Math.exp(-a/n),f=l+(o.positionX-l)*d,p=u+(o.positionY-u)*d,m=Math.abs(o.positionX-f)<.5&&Math.abs(o.positionY-p)<.5;m&&(f=o.positionX,p=o.positionY),e.isAnimating=!m,e.setState(c,f,p),m?at(e):e.animationFrame=requestAnimationFrame(i)}}};e.animation=i,e.resizeAnimation=i,e.animationResolve=null,e.animationFrame=requestAnimationFrame(i)}function st(e){if(e.setup.disabled)w(e,e.state.scale);else if(nt(e))e.isResizeAlignmentPending=!0;else{var t=e.animation!==null&&e.animation===e.resizeAnimation;if(e.animation&&!t){var n=e.state.scale,r=e.setup,i=r.minScale,a=r.maxScale;if(n<i||n>a){e.isResizeAlignmentPending=!0;return}g(e)}var o=it(e);o?t||(e.setup.autoAlignment.animationTime===0?e.setState(o.scale,o.positionX,o.positionY):ot(e)):t&&at(e)}}function ct(e){var t=e.wrapperComponent,n=e.contentComponent;if(t&&n){var r=et(t,n);tt(e.measuredSizes,r)&&(e.measuredSizes=r,st(e))}}var lt=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,a=n.touchPadDisabled,o=n.excluded,s=e.isInitialized,c=e.isPanning,l=t.target;return!(!s||c||r||!l||t.deltaY===0||i&&!t.ctrlKey||a&&t.ctrlKey||J(l,o)||!e.isPressingKeys(e.setup.wheel.activationKeys))},ut=function(e,t){var n=e.setup,r=n.disabled,i=n.trackPadPanning,a=i.activationKeys,o=i.excluded;if(!e.wrapperComponent||!e.contentComponent||r||i.disabled||t.ctrlKey||lt(e,t))return!1;var s=t.target;return!(J(s,o)||!e.isPressingKeys(a))},dt=function(e){return e?e.deltaY<0?1:-1:0};function ft(e,t){return f(t,dt(e))}function pt(e,t,n){var r=t.getBoundingClientRect(),i=0,a=0;if(`clientX`in e)i=(e.clientX-r.left)/n,a=(e.clientY-r.top)/n;else{var o=e.touches[0];i=(o.clientX-r.left)/n,a=(o.clientY-r.top)/n}return Number.isNaN(i)||Number.isNaN(a)?(console.error(`No mouse or touch offset found`),{x:0,y:0}):{x:i,y:a}}var mt=function(e,t,n,r,i){var a=e.state.scale,o=e.wrapperComponent,s=e.setup,c=s.maxScale,l=s.minScale,u=s.zoomAnimation,d=s.disablePadding,f=u.size,p=u.disabled;if(!o)throw Error(`Wrapper is not mounted`);var m=a+t*n;return i?m:O(m,l,c,f,!r&&!p&&!d)},ht=function(e,t){var n=e.previousWheelEvent,r=e.state.scale,i=e.setup,a=i.maxScale,o=i.minScale;return n?r<a||r>o||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},gt=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,a=e.isInitialized,o=t.target;return!(!(a&&!r&&o)||J(o,i))},_t=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||r===null)},vt=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,a=i[0].clientX-r.left,o=i[0].clientY-r.top,s=i[1].clientX-r.left,c=i[1].clientY-r.top;return{x:(a+s)/2/t,y:(o+c)/2/t}},yt=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)**2+(e.touches[0].pageY-e.touches[1].pageY)**2)},bt=5,xt=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,a=i.maxScale,o=i.minScale,s=i.zoomAnimation,c=i.disablePadding,l=i.pinch,u=s.size,f=s.disabled,p=l.step;if(!n||r===null)throw Error(`Pinch touches distance was not provided`);if(t<0)return e.state.scale;var m=n+(t/r*n-n)*(p/bt);return O(m===1/0?0:d(m,10),o,a,u,!f&&!c)},St=160,Ct=100,wt=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;g(e),e.wheelStopEventTimer||(p(W(e),t,r),p(W(e),t,i))},Tt=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,a=e.contentComponent,o=e.setup,s=e.state.scale,c=o.limitToBounds,l=o.centerZoomedOut,u=o.zoomAnimation,d=o.wheel,f=o.disablePadding,m=o.smooth,h=u.size,g=u.disabled,_=d.step;if(!a)throw Error(`Component not mounted`);t.cancelable&&t.preventDefault(),t.stopPropagation();var v=mt(e,ft(t,null),m?_*Math.abs(t.deltaY):_,!t.ctrlKey);if(s!==v){var y=w(e,v),b=pt(t,a,s),x=c&&(g||h===0||l||f),S=E(e,b.x,b.y,v,y,x),C=S.x,T=S.y;e.previousWheelEvent=t,e.setState(v,C,T),p(W(e),t,r),p(W(e),t,i)}},Et=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;X(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(me(e,t.x,t.y),e.wheelAnimationTimer=null,e.flushResizeAlignment())},Ct),ht(e,t)&&(X(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,p(W(e),t,r),p(W(e),t,i),e.flushResizeAlignment())},St))},Dt=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onPanningStart;g(e),e.wheelStopEventTimer||(e.wheelAnimationTimer||w(e,e.state.scale),p(W(e),t,r),p(W(e),t,i))},Ot=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onPanningStop;X(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(me(e,t.x,t.y),e.wheelAnimationTimer=null,e.flushResizeAlignment())},Ct),ht(e,t)&&(X(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,p(W(e),t,r),p(W(e),t,i),e.flushResizeAlignment())},St))},kt=function(e){for(var t=0,n=0,r=0;r<2;r+=1)t+=e.touches[r].clientX,n+=e.touches[r].clientY;return{x:t/2,y:n/2}},At=function(e,t){var n=yt(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.state.scale,e.isPanning=!1,e.isPinching=!0,e.pinchPreviousCenter=kt(t),g(e)},jt=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.wrapperComponent,a=e.pinchPreviousCenter,o=e.state.scale,s=e.setup,c=s.limitToBounds,l=s.centerZoomedOut,u=s.zoomAnimation,d=s.autoAlignment,f=s.pinch,p=s.panning,m=u.disabled,h=u.size,g=f.allowPanning;if(r!==null&&n){var _=vt(t,o,n);if(Number.isFinite(_.x)&&Number.isFinite(_.y)){var v=yt(t),y=xt(e,v),b=kt(t),x=o/y,S=(b.x-(a?.x||0))*x,C=(b.y-(a?.y||0))*x;if(y!==o||S!==0||C!==0){e.pinchPreviousCenter=b;var D=w(e,y),O=c&&(m||h===0||l),k=E(e,_.x,_.y,y,D,O),A=k.x,j=k.y;if(e.pinchMidpoint=_,e.lastDistance=v,p.disabled||!g)e.setState(y,A,j);else{var ee=d.sizeX,te=d.sizeY,M=N(e,ee,y),ne=N(e,te,y),P=T(A+S,j+C,D,c,M,ne,i),re=P.x,ie=P.y;e.setState(y,re,ie)}}}}},Mt=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,e.isPinching=!1,me(e,t?.x,t?.y)},Nt=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;X(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,e.mounted&&p(W(e),t,n)},r)},Pt=function(e,t){var n=e.props,r=n.onZoomStart,i=n.onZoom,a=e.setup.doubleClick,o=a.animationTime,s=a.animationType;p(W(e),t,r),xe(e,o,s,function(){return p(W(e),t,i)}),Nt(e,t)};function Ft(e,t){return e===`toggle`?t===1?1:-1:e===`zoomOut`?-1:1}function It(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,i=e.state,a=e.contentComponent,o=i.scale,s=e.props,c=s.onZoomStart,l=s.onZoom,u=n.doubleClick,d=u.disabled,f=u.mode,m=u.step,h=u.animationTime,g=u.animationType;if(!d&&!r){if(f===`reset`)return Pt(e,t);if(!a)return console.error(`No ContentComponent found`);var _=ve(e,Ft(f,e.state.scale),m);if(o!==_){p(W(e),t,c);var v=pt(t,a,o),b=I(e,_,v.x,v.y);if(!b)return console.error(`Error during zoom event. New transformation state was not calculated.`);p(W(e),t,l),y(e,b,h,g),Nt(e,t)}}}var Lt=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,a=r.doubleClick,o=a.disabled,s=a.excluded,c=t.target,l=i?.contains(c);return!(!(n&&c&&l&&!o)||J(c,s)||Y(c))},Rt=function(){function e(e){var t=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.onTransformCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.panStartPosition=null,this.lastTouch=null,this.isPinching=!1,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.pinchPreviousCenter=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.isAnimating=!1,this.animation=null,this.animationFrame=null,this.animationResolve=null,this.initObserverTimer=null,this.isInitialLayoutPending=!1,this.measuredSizes=null,this.isResizeAlignmentPending=!1,this.resizeAnimation=null,this.pressedKeys={},this.selectionLock=null,this.mount=function(){t.mounted=!0,t.initializeWindowEvents()},this.unmount=function(){t.mounted=!1,t.cleanupWindowEvents()},this.update=function(e){t.props=e,t.setup=_e(e),t.wrapperComponent&&t.contentComponent&&!rt(t)&&w(t,t.state.scale)},this.clearTimers=function(){t.wheelStopEventTimer&&clearTimeout(t.wheelStopEventTimer),t.wheelAnimationTimer&&clearTimeout(t.wheelAnimationTimer),t.doubleClickStopEventTimer&&clearTimeout(t.doubleClickStopEventTimer),t.initObserverTimer&&clearTimeout(t.initObserverTimer),t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.doubleClickStopEventTimer=null,t.initObserverTimer=null},this.initializeWindowEvents=function(){var e,n,r,i=K(),a=t.wrapperComponent?.ownerDocument,o=a?.defaultView;(e=t.wrapperComponent)==null||e.addEventListener(`wheel`,t.onWheelPanning,i),(n=t.wrapperComponent)==null||n.addEventListener(`keyup`,t.setKeyUnPressed,i),(r=t.wrapperComponent)==null||r.addEventListener(`keydown`,t.setKeyPressed,i),o?.addEventListener(`mousedown`,t.onPanningStart,i),o?.addEventListener(`mousemove`,t.onPanning,i),o?.addEventListener(`mouseup`,t.onPanningStop,i),a?.addEventListener(`mouseleave`,t.clearPanning,i),o?.addEventListener(`keyup`,t.setKeyUnPressed,i),o?.addEventListener(`keydown`,t.setKeyPressed,i),o?.addEventListener(`blur`,t.handleWindowBlur)},this.cleanupWindowEvents=function(){var e,n,r,i,a=K(),o=t.wrapperComponent?.ownerDocument,s=o?.defaultView;s?.removeEventListener(`mousedown`,t.onPanningStart,a),s?.removeEventListener(`mousemove`,t.onPanning,a),s?.removeEventListener(`mouseup`,t.onPanningStop,a),o?.removeEventListener(`mouseleave`,t.clearPanning,a),s?.removeEventListener(`keyup`,t.setKeyUnPressed,a),s?.removeEventListener(`keydown`,t.setKeyPressed,a),s?.removeEventListener(`blur`,t.handleWindowBlur),(e=t.wrapperComponent)==null||e.removeEventListener(`wheel`,t.onWheelPanning,a),(n=t.wrapperComponent)==null||n.removeEventListener(`keyup`,t.setKeyUnPressed,a),(r=t.wrapperComponent)==null||r.removeEventListener(`keydown`,t.setKeyPressed,a),t.cleanupWrapperEvents(),t.clearTimers(),g(t),t.unlockTextSelection(),(i=t.observer)==null||i.disconnect(),t.observer=void 0,t.isInitialLayoutPending=!1,t.isResizeAlignmentPending=!1,t.resizeAnimation=null},this.cleanupWrapperEvents=function(){var e=t.wrapperComponent;if(e){var n=K();e.removeEventListener(`wheel`,t.onWheelZoom,n),e.removeEventListener(`dblclick`,t.onDoubleClick,n),e.removeEventListener(`keydown`,t.onKeyboardNavigation,n),e.removeEventListener(`touchstart`,t.onTouchPanningStart,n),e.removeEventListener(`touchmove`,t.onTouchPanning,n),e.removeEventListener(`touchend`,t.onTouchPanningStop,n)}},this.handleInitializeWrapperEvents=function(e){var n=K();e.addEventListener(`wheel`,t.onWheelZoom,n),e.addEventListener(`dblclick`,t.onDoubleClick,n),e.addEventListener(`keydown`,t.onKeyboardNavigation,n),e.addEventListener(`touchstart`,t.onTouchPanningStart,n),e.addEventListener(`touchmove`,t.onTouchPanning,n),e.addEventListener(`touchend`,t.onTouchPanningStop,n)},this.handleInitialize=function(){var e=t.setup,n=e.centerOnInit,r=e.fitOnInit;if(t.applyTransformation(),t.onInitCallbacks.forEach(function(e){return e(W(t))}),n||r){var i=t.applyInitialLayout();t.isInitialLayoutPending=!0,t.initObserverTimer&&clearTimeout(t.initObserverTimer),i&&(t.initObserverTimer=setTimeout(function(){t.initObserverTimer=null,t.isInitialLayoutPending=!1},5e3))}},this.observeSizes=function(e,n){var r;(r=t.observer)==null||r.disconnect(),t.observer=void 0,t.measuredSizes=et(e,n),typeof ResizeObserver<`u`&&(t.observer=new ResizeObserver(t.onSizeChange),t.observer.observe(e),t.observer.observe(n))},this.onSizeChange=function(){var e=t,n=e.wrapperComponent,r=e.contentComponent;if(t.mounted&&n&&r){if(t.isInitialLayoutPending){if(!((r.offsetWidth>0||r.offsetHeight>0)&&n.clientWidth>0&&n.clientHeight>0))return;t.isInitialLayoutPending=!1,t.initObserverTimer&&clearTimeout(t.initObserverTimer),t.initObserverTimer=null,t.onInitCallbacks.forEach(function(e){return e(W(t))}),t.applyInitialLayout(),t.measuredSizes=et(n,r),w(t,t.state.scale)}else ct(t)}},this.flushResizeAlignment=function(){t.isResizeAlignmentPending&&(t.isResizeAlignmentPending=!1,st(t))},this.onWheelZoom=function(e){t.setup.disabled||(t.syncModifierKeys(e),lt(t,e)&&(wt(t,e),Tt(t,e),Et(t,e)))},this.onWheelPanning=function(e){var n=t.props.onPanning,r=t.setup.trackPadPanning,i=r.lockAxisX,a=r.lockAxisY;if(t.syncModifierKeys(e),ut(t,e)){e.cancelable&&e.preventDefault(),e.stopPropagation();var o=t.state,s=o.positionX,c=o.positionY,l=s-e.deltaX,u=c-e.deltaY,d=i?s:l,f=a?c:u,m=t.setup.autoAlignment,h=m.sizeX,g=m.sizeY,_=N(t,h),v=N(t,g);(d!==s||f!==c)&&(Dt(t,e),M(t,d,f,_,v),p(W(t),e,n),Ot(t,e))}},this.onPanningStart=function(e){var n=t.setup,r=n.disabled,i=n.panning,a=t.props.onPanningStart;r||i.disabled||(t.syncModifierKeys(e),k(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.button!==0||t.setup.panning.allowLeftClickPan)&&(e.button!==1||t.setup.panning.allowMiddleClickPan)&&(e.button!==2||t.setup.panning.allowRightClickPan)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),g(t),ue(t,e),t.lockTextSelection(),t.focusForKeyboard(),p(W(t),e,a)))},this.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||(t.syncModifierKeys(e),t.isPanning&&e.buttons===0?t.clearPanning(e):A(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),fe(t,e.clientX,e.clientY,P.MOUSE),p(W(t),e,r)))},this.onPanningStop=function(e){var n=t.setup.panning.velocityDisabled,r=t.props.onPanningStop;t.isPanning&&(t.unlockTextSelection(),pe(t,n),p(W(t),e,r),t.flushResizeAlignment())},this.onPinchStart=function(e){var n=t.setup.disabled,r=t.props.onPinchStart;n||gt(t,e)&&(At(t,e),g(t),p(W(t),e,r))},this.onPinch=function(e){var n=t.setup.disabled,r=t.props.onPinch;n||_t(t)&&(e.cancelable&&e.preventDefault(),e.stopPropagation(),jt(t,e),p(W(t),e,r))},this.onPinchStop=function(e){var n=t.props.onPinchStop;t.pinchStartScale&&(Mt(t),p(W(t),e,n),t.flushResizeAlignment())},this.onTouchPanningStart=function(e){var n=t.setup,r=n.disabled,i=n.doubleClick,a=t.props.onPanningStart;if(!r){var o=!i?.disabled,s=t.lastTouch&&+new Date-t.lastTouch<200;if(o&&s&&e.touches.length===1)t.lastTouch=null,t.onDoubleClick(e);else{t.lastTouch=+new Date,g(t);var c=e.touches,l=c.length===1,u=c.length===2,d=k(t,e);if(l){if(!d||t.setup.panning.disabled)return;g(t),ue(t,e),t.lockTextSelection(),t.focusForKeyboard(),p(W(t),e,a)}u&&t.onPinchStart(e)}}},this.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&e.touches.length===1){if(n||!A(t))return;e.cancelable&&e.preventDefault(),e.stopPropagation();var i=e.touches[0];fe(t,i.clientX,i.clientY,P.TOUCH),p(W(t),e,r)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){t.setup.disabled||Lt(t,e)&&It(t,e)},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.handleWindowBlur=function(){t.pressedKeys={},t.isPanning&&(t.isPanning=!1,t.startCoords=null),t.unlockTextSelection(),t.flushResizeAlignment()},this.syncModifierKeys=function(e){var n=e.ctrlKey,r=e.metaKey,i=e.shiftKey,a=e.altKey;typeof n==`boolean`&&(t.pressedKeys.Control=n),typeof r==`boolean`&&(t.pressedKeys.Meta=r),typeof i==`boolean`&&(t.pressedKeys.Shift=i),typeof a==`boolean`&&(t.pressedKeys.Alt=a)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return typeof e==`function`?e(Object.entries(t.pressedKeys).filter(function(e){return e[1]}).map(function(e){return e[0]})):!e.length||!!e.every(function(e){return t.pressedKeys[e]})},this.onKeyboardNavigation=function(e){$e(t,e)},this.focusForKeyboard=function(){var e=t.wrapperComponent;if(e&&!t.setup.keyboard.disabled){var n=e.ownerDocument?.activeElement;n&&e.contains(n)||typeof e.focus==`function`&&e.focus({preventScroll:!0})}},this.lockTextSelection=function(){var e=t.wrapperComponent;e&&!t.selectionLock&&(t.selectionLock={userSelect:e.style.userSelect,webkitUserSelect:e.style.webkitUserSelect},e.style.userSelect=`none`,e.style.webkitUserSelect=`none`)},this.unlockTextSelection=function(){var e=t.selectionLock;t.selectionLock=null;var n=t.wrapperComponent;n&&e&&(n.style.userSelect=e.userSelect,n.style.webkitUserSelect=e.webkitUserSelect)},this.applyInitialLayout=function(){var e=t.setup.fitOnInit,n=t,r=n.wrapperComponent,i=n.contentComponent,a=!!r&&!!i&&r.clientWidth>0&&r.clientHeight>0&&(i.offsetWidth>0||i.offsetHeight>0);if(e){var o=H(t,e===`cover`?`cover`:`contain`);if(o)return t.setState(o.scale,o.positionX,o.positionY),a}return t.setCenter(),a},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Z(t.state.scale,t.wrapperComponent,t.contentComponent);t.setState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,r){return t.props.customTransform?t.props.customTransform(e,n,r):qe(e,n,r)},this.getContext=function(){return W(t)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.state,n=e.scale,r=e.positionX,i=e.positionY,a=t.handleTransformStyles(r,i,n);t.props.detached||(t.contentComponent.style.transform=a),t.onTransformCallbacks.forEach(function(e){return e({scale:n,positionX:r,positionY:i,previousScale:t.state.previousScale,ref:W(t)})})}},this.setState=function(e,n,r){var i=t.props.onTransform;if(!Number.isNaN(e)&&!Number.isNaN(n)&&!Number.isNaN(r)){var a=Math.max(e,1e-7);a!==t.state.scale&&(t.state.previousScale=t.state.scale,t.state.scale=a),t.state.positionX=n,t.state.positionY=r,t.applyTransformation();var o=W(t);t.onChangeCallbacks.forEach(function(e){return e(o)}),p(o,{scale:t.state.scale,positionX:n,positionY:r},i)}else console.error(`Detected NaN set state values`)},this.onTransform=function(e){return t.onTransformCallbacks.has(e)||t.onTransformCallbacks.add(e),function(){t.onTransformCallbacks.delete(e)}},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.mounted=!0,t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,w(t,t.state.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.observeSizes(e,n),t.initializeWindowEvents(),t.isInitialized=!0;var r=W(t);p(r,void 0,t.props.onInit),Je(t.props.ref,r)},this.props=e,this.setup=_e(this.props),this.state=ge(this.props)}return e}(),Q=l.createContext(null),zt=function(e,t){return typeof e==`function`?e(t):e},Bt=l.forwardRef(function(e,t){var n=(0,l.useRef)(null);n.current===null&&(n.current=new Rt(e));var r=n.current,i=zt(e.children,U(r));return(0,l.useImperativeHandle)(t,function(){return U(r)},[r]),(0,l.useEffect)(function(){return r.mount(),function(){r.unmount()}},[r]),(0,l.useEffect)(function(){r.update(e)},[r,e]),(0,u.jsx)(Q.Provider,L({value:r},{children:i}))});l.forwardRef(function(e,t){var n=(0,l.useRef)(null),r=(0,l.useContext)(Q);return Xe(function(){var e=function(e){if(n.current){var t=0,i=0;n.current.style.transform=r.handleTransformStyles(t,i,1/e)}};return e(r.state.scale),r.onChange(function(t){e(t.instance.state.scale)})},[r]),(0,u.jsx)(`div`,L({},e,{ref:Ye([n,t])}))});function Vt(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Ht=`.transform-component-module_wrapper__SPB86 {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: -moz-fit-content;
|
|
4
4
|
width: fit-content;
|
|
@@ -38,4 +38,4 @@ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{t}from"./MinusSignIcon
|
|
|
38
38
|
background-size: 20px 20px;
|
|
39
39
|
background-position: 0 0;
|
|
40
40
|
}
|
|
41
|
-
`,$={wrapper:`transform-component-module_wrapper__SPB86`,content:`transform-component-module_content__FBWxo`,infiniteGrid:`transform-component-module_infiniteGrid__Z-aP3`};Vt(Ht);var Ut=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?``:n,i=e.contentClass,a=i===void 0?``:i,o=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,d=c===void 0?{}:c,f=e.contentProps,p=f===void 0?{}:f,m=e.infinite,h=m!==void 0&&m,g=(0,l.useContext)(Q),_=g.init,v=g.cleanupWindowEvents,y=(0,l.useRef)(null),b=(0,l.useRef)(null),x=(0,l.useRef)(null);Xe(function(){var e=y.current,t=b.current;return e!==null&&t!==null&&_&&_?.(e,t),function(){v?.()}},[]),(0,l.useEffect)(function(){if(h){var e=x.current;if(e){var t=function(){var t=g.state,n=t.positionX,r=t.positionY;e.style.backgroundPosition=`${n}px ${r}px`};return t(),g.onChange(t)}}},[h,g]);var S=!g.setup.keyboard?.disabled;return(0,u.jsxs)(`div`,L({tabIndex:S?0:void 0},d,{ref:y,className:`${B.wrapperClass} ${$.wrapper} ${r}`,style:o},{children:[h&&(0,u.jsx)(`div`,{ref:x,className:$.infiniteGrid,"aria-hidden":!0}),(0,u.jsx)(`div`,L({},p,{ref:b,className:`${B.contentClass} ${$.content} ${a}`,style:L(L({transformOrigin:`0 0`},s),{transform:qe(g.state.positionX,g.state.positionY,g.state.scale)})},{children:t}))]}))};function Wt(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function Gt(e){var t=e.elementX,n=e.elementY,r=e.elementWidth,i=e.elementHeight,a=e.scale,o=e.positionX,s=e.positionY,c=e.viewportWidth,l=e.viewportHeight,u=e.margin,d=u===void 0?0:u,f=e.threshold,p=f===void 0?0:f,m={x:-d,y:-d,width:c+2*d,height:l+2*d},h={x:t*a+o,y:n*a+s,width:r*a,height:i*a};if(p<=0){var g=h.x<m.x+m.width&&h.x+h.width>m.x,_=h.y<m.y+m.height&&h.y+h.height>m.y;return g&&_}var v=h.width*h.height;return v<=0?!1:Wt(m,h)/v>=p}l.forwardRef(function(e,t){var n=e.x,r=e.y,i=e.width,a=e.height,o=e.margin,s=o===void 0?0:o,c=e.threshold,d=c===void 0?0:c,f=e.placeholder,p=f===void 0?null:f,m=e.onShow,h=e.onHide,g=e.children,_=e.className,v=e.style,y=(0,l.useContext)(Q),b=function(){var e=y.wrapperComponent;return e?Gt({elementX:n,elementY:r,elementWidth:i,elementHeight:a,scale:y.state.scale,positionX:y.state.positionX,positionY:y.state.positionY,viewportWidth:e.clientWidth,viewportHeight:e.clientHeight,margin:s,threshold:d}):!1},x=(0,l.useState)(b),S=x[0],C=x[1],w=(0,l.useRef)(!1),T=(0,l.useRef)(m),E=(0,l.useRef)(h);return T.current=m,E.current=h,Xe(function(){var e=function(){var e,t;if(y.wrapperComponent){var n=b();n!==w.current&&(w.current=n,C(n),n?(e=T.current)==null||e.call(T):(t=E.current)==null||t.call(E))}};e();var t=y.onChange(e),n;return y.wrapperComponent||(n=y.onInit(function(){return e()})),function(){t(),n?.()}},[y,n,r,i,a,s,d]),S?(0,u.jsx)(`div`,L({ref:t,className:_,style:v},{children:g})):p?(0,u.jsx)(u.Fragment,{children:p}):null});function Kt(e){let o=(0,l.useRef)({x:0,y:0}),s=(0,l.useRef)(null);return(0,u.jsx)(Bt,{minScale:1,maxScale:12,wheel:{activationKeys:e=>e.includes(`Meta`)||e.includes(`Control`)},trackPadPanning:{disabled:!1},doubleClick:{mode:`toggle`,step:1.5},keyboard:{disabled:!1},children:l=>(0,u.jsxs)(`div`,{className:`relative size-full`,children:[(0,u.jsx)(Ut,{wrapperClass:`size-full! outline-none`,contentClass:`size-full! items-center justify-center p-4 sm:p-12`,contentProps:{onPointerDown:e=>{o.current={x:e.clientX,y:e.clientY}},onClick:t=>{if(s.current===null)return;let n=s.current.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&Math.hypot(t.clientX-o.current.x,t.clientY-o.current.y)<4&&e.onClose?.()}},children:(0,u.jsx)(`img`,{ref:s,src:e.src,alt:e.alt,draggable:!1,className:`pointer-events-auto! max-h-full max-w-full object-contain select-none`})}),(0,u.jsxs)(`div`,{className:`absolute bottom-4 left-1/2 flex -translate-x-1/2 items-center gap-0.5 rounded-full bg-black/60 p-1 text-white backdrop-blur-sm`,children:[(0,u.jsx)(r,{label:`Zoom out`,children:(0,u.jsx)(
|
|
41
|
+
`,$={wrapper:`transform-component-module_wrapper__SPB86`,content:`transform-component-module_content__FBWxo`,infiniteGrid:`transform-component-module_infiniteGrid__Z-aP3`};Vt(Ht);var Ut=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?``:n,i=e.contentClass,a=i===void 0?``:i,o=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,d=c===void 0?{}:c,f=e.contentProps,p=f===void 0?{}:f,m=e.infinite,h=m!==void 0&&m,g=(0,l.useContext)(Q),_=g.init,v=g.cleanupWindowEvents,y=(0,l.useRef)(null),b=(0,l.useRef)(null),x=(0,l.useRef)(null);Xe(function(){var e=y.current,t=b.current;return e!==null&&t!==null&&_&&_?.(e,t),function(){v?.()}},[]),(0,l.useEffect)(function(){if(h){var e=x.current;if(e){var t=function(){var t=g.state,n=t.positionX,r=t.positionY;e.style.backgroundPosition=`${n}px ${r}px`};return t(),g.onChange(t)}}},[h,g]);var S=!g.setup.keyboard?.disabled;return(0,u.jsxs)(`div`,L({tabIndex:S?0:void 0},d,{ref:y,className:`${B.wrapperClass} ${$.wrapper} ${r}`,style:o},{children:[h&&(0,u.jsx)(`div`,{ref:x,className:$.infiniteGrid,"aria-hidden":!0}),(0,u.jsx)(`div`,L({},p,{ref:b,className:`${B.contentClass} ${$.content} ${a}`,style:L(L({transformOrigin:`0 0`},s),{transform:qe(g.state.positionX,g.state.positionY,g.state.scale)})},{children:t}))]}))};function Wt(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function Gt(e){var t=e.elementX,n=e.elementY,r=e.elementWidth,i=e.elementHeight,a=e.scale,o=e.positionX,s=e.positionY,c=e.viewportWidth,l=e.viewportHeight,u=e.margin,d=u===void 0?0:u,f=e.threshold,p=f===void 0?0:f,m={x:-d,y:-d,width:c+2*d,height:l+2*d},h={x:t*a+o,y:n*a+s,width:r*a,height:i*a};if(p<=0){var g=h.x<m.x+m.width&&h.x+h.width>m.x,_=h.y<m.y+m.height&&h.y+h.height>m.y;return g&&_}var v=h.width*h.height;return v<=0?!1:Wt(m,h)/v>=p}l.forwardRef(function(e,t){var n=e.x,r=e.y,i=e.width,a=e.height,o=e.margin,s=o===void 0?0:o,c=e.threshold,d=c===void 0?0:c,f=e.placeholder,p=f===void 0?null:f,m=e.onShow,h=e.onHide,g=e.children,_=e.className,v=e.style,y=(0,l.useContext)(Q),b=function(){var e=y.wrapperComponent;return e?Gt({elementX:n,elementY:r,elementWidth:i,elementHeight:a,scale:y.state.scale,positionX:y.state.positionX,positionY:y.state.positionY,viewportWidth:e.clientWidth,viewportHeight:e.clientHeight,margin:s,threshold:d}):!1},x=(0,l.useState)(b),S=x[0],C=x[1],w=(0,l.useRef)(!1),T=(0,l.useRef)(m),E=(0,l.useRef)(h);return T.current=m,E.current=h,Xe(function(){var e=function(){var e,t;if(y.wrapperComponent){var n=b();n!==w.current&&(w.current=n,C(n),n?(e=T.current)==null||e.call(T):(t=E.current)==null||t.call(E))}};e();var t=y.onChange(e),n;return y.wrapperComponent||(n=y.onInit(function(){return e()})),function(){t(),n?.()}},[y,n,r,i,a,s,d]),S?(0,u.jsx)(`div`,L({ref:t,className:_,style:v},{children:g})):p?(0,u.jsx)(u.Fragment,{children:p}):null});function Kt(e){let o=(0,l.useRef)({x:0,y:0}),s=(0,l.useRef)(null);return(0,u.jsx)(Bt,{minScale:1,maxScale:12,wheel:{activationKeys:e=>e.includes(`Meta`)||e.includes(`Control`)},trackPadPanning:{disabled:!1},doubleClick:{mode:`toggle`,step:1.5},keyboard:{disabled:!1},children:l=>(0,u.jsxs)(`div`,{className:`relative size-full`,children:[(0,u.jsx)(Ut,{wrapperClass:`size-full! outline-none`,contentClass:`size-full! items-center justify-center p-4 sm:p-12`,contentProps:{onPointerDown:e=>{o.current={x:e.clientX,y:e.clientY}},onClick:t=>{if(s.current===null)return;let n=s.current.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&Math.hypot(t.clientX-o.current.x,t.clientY-o.current.y)<4&&e.onClose?.()}},children:(0,u.jsx)(`img`,{ref:s,src:e.src,alt:e.alt,draggable:!1,className:`pointer-events-auto! max-h-full max-w-full object-contain select-none`})}),(0,u.jsxs)(`div`,{className:`absolute bottom-4 left-1/2 flex -translate-x-1/2 items-center gap-0.5 rounded-full bg-black/60 p-1 text-white backdrop-blur-sm`,children:[(0,u.jsx)(r,{label:`Zoom out`,children:(0,u.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom out`,className:`rounded-full text-white hover:bg-white/15`,onClick:()=>void l.zoomOut(),children:(0,u.jsx)(i,{icon:t,className:`size-4 text-current`})})}),(0,u.jsx)(r,{label:`Zoom in`,children:(0,u.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom in`,className:`rounded-full text-white hover:bg-white/15`,onClick:()=>void l.zoomIn(),children:(0,u.jsx)(i,{icon:n,className:`size-4 text-current`})})}),(0,u.jsx)(r,{label:`Fit to screen`,children:(0,u.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Fit to screen`,className:`rounded-full text-white hover:bg-white/15`,onClick:()=>void l.resetTransform(),children:(0,u.jsx)(i,{icon:c,className:`size-4 text-current`})})})]})]})})}export{Kt as t};
|
|
@@ -10,24 +10,22 @@
|
|
|
10
10
|
name="viewport"
|
|
11
11
|
content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-BwVrIQyk.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COiEfhsA.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/utils-U6QfaJBO.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/button-CdLSr6OC.js">
|
|
17
16
|
<link rel="modulepreload" crossorigin href="/assets/tags-DrTyXsO5.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/TextWrapIcon-CaHR7d2a.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/button-CWFREsRn.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-C_Y10kCd.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-CVA2QYzo.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/XIcon-C8QiXos4.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/preview-dialog-DvyH_XYP.js">
|
|
20
23
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BLdHbfdN.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/ccount-D7kz22QW.js">
|
|
22
25
|
<link rel="modulepreload" crossorigin href="/assets/langs-DssLtjmH.js">
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-DygZhkc7.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/appendItems-C8N70W-m.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/constants-CmGPilXJ.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/formatCSSVariablePrefix-KRh9vnZf.js">
|
|
30
|
-
<link rel="stylesheet" crossorigin href="/assets/index-4D8bvVNO.css">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/context-menu-CniNpkSW.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/libesm-Dyf3eB1R.js">
|
|
28
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DkhFb5Mr.css">
|
|
31
29
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
32
30
|
<body>
|
|
33
31
|
<div id="root"></div>
|