@galacean/cli 2.0.0-alpha.11 → 2.0.0-alpha.12
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/dist/cli.bundle.cjs +3084 -2863
- package/dist/viewport-client/_static/Accordion-4897319b.js +6 -0
- package/dist/viewport-client/_static/AmbientLightAsset-f70b95f1.js +5 -0
- package/dist/viewport-client/_static/AnimationClipAsset-01f3deb6.js +1 -0
- package/dist/viewport-client/_static/AnimatorControllerAsset-b7424e9c.js +1 -0
- package/dist/viewport-client/_static/AnimatorStore-fd98c00e.js +1 -0
- package/dist/viewport-client/_static/AssetPreviewer-24e31d97.js +6 -0
- package/dist/viewport-client/_static/AssetViewer-bc198e16.js +1 -0
- package/dist/viewport-client/_static/AudioAsset-eae03324.js +1 -0
- package/dist/viewport-client/_static/AudioComponent-44070c2c.js +1 -0
- package/dist/viewport-client/_static/Callout-cb4a55ff.js +1 -0
- package/dist/viewport-client/_static/CameraComponent-907ac745.js +1 -0
- package/dist/viewport-client/_static/CanvasRenderer-9dd98cb3.js +1 -0
- package/dist/viewport-client/_static/Component-f923abb1.js +1 -0
- package/dist/viewport-client/_static/DirectLight-58f5fe9e.js +1 -0
- package/dist/viewport-client/_static/FontAsset-abfb9a8a.js +5 -0
- package/dist/viewport-client/_static/FormItemArray-66be8701.js +1 -0
- package/dist/viewport-client/_static/GlTFAsset-9c68f862.js +20 -0
- package/dist/viewport-client/_static/IconPlayerPlayFilled-b058c98f.js +6 -0
- package/dist/viewport-client/_static/IconPointFilled-a304fd34.js +6 -0
- package/dist/viewport-client/_static/InstanceEditorAsset-a70e73fe.js +1 -0
- package/dist/viewport-client/_static/LightBaseComponent-fbc3ae49.js +1 -0
- package/dist/viewport-client/_static/LottieAnimationComponent-1c3e02a5.js +1 -0
- package/dist/viewport-client/_static/LottieAsset-377c1419.js +1 -0
- package/dist/viewport-client/_static/MarkdownAsset-7ea387a9.js +1 -0
- package/dist/viewport-client/_static/MaterialAsset-74a15124.js +1 -0
- package/dist/viewport-client/_static/MaterialInspector-aec1248b.js +1 -0
- package/dist/viewport-client/_static/Menu-cd3be298.js +17 -0
- package/dist/viewport-client/_static/MeshAsset-73e2cc8e.js +1 -0
- package/dist/viewport-client/_static/MeshRendererBaseComponent-3a0e09ed.js +1 -0
- package/dist/viewport-client/_static/MeshRendererComponent-5385d30f.js +1 -0
- package/dist/viewport-client/_static/MeshThumbnail-49273f71.js +1 -0
- package/dist/viewport-client/_static/ParticleRendererComponent-5a7b57d9.js +21 -0
- package/dist/viewport-client/_static/PhysicsMaterialAsset-a5ac9f82.js +1 -0
- package/dist/viewport-client/_static/PhysicsStore-0729e76d.js +1 -0
- package/dist/viewport-client/_static/PointLight-0e1d1546.js +1 -0
- package/dist/viewport-client/_static/PostProcessComponent-8276d33c.js +1 -0
- package/dist/viewport-client/_static/PrefabAsset-1a7edfbd.js +1 -0
- package/dist/viewport-client/_static/PrimitiveMesh-3ce6fa2f.js +1 -0
- package/dist/viewport-client/_static/ProxyConfigs-4de3304c.js +1 -0
- package/dist/viewport-client/_static/ReferencedMaterial-a87818f3.js +1 -0
- package/dist/viewport-client/_static/RenderTargetAsset-33c0d9e7.js +1 -0
- package/dist/viewport-client/_static/SceneAsset-8917c210.js +1 -0
- package/dist/viewport-client/_static/ShaderAsset-cb3ff628.js +185 -0
- package/dist/viewport-client/_static/ShaderChunkAsset-83f923f4.js +5 -0
- package/dist/viewport-client/_static/ShaderUIScriptAsset-d13fa4e2.js +516 -0
- package/dist/viewport-client/_static/SkinnedMeshRendererComponent-2a8323bf.js +1 -0
- package/dist/viewport-client/_static/SpineAnimationComponent-e733d50f.js +1 -0
- package/dist/viewport-client/_static/SpineSkeletonDataAsset-b64a3ee3.js +1 -0
- package/dist/viewport-client/_static/SpotLight-ca6c0c3b.js +1 -0
- package/dist/viewport-client/_static/SpriteAsset-9a31ec24.js +1 -0
- package/dist/viewport-client/_static/SpriteAtlasAsset-a862db46.js +1 -0
- package/dist/viewport-client/_static/SpriteBaseComponent-f6f1731f.js +1 -0
- package/dist/viewport-client/_static/SpriteMaskComponent-778be04f.js +1 -0
- package/dist/viewport-client/_static/SpriteRendererComponent-2b4d153b.js +1 -0
- package/dist/viewport-client/_static/TaskQueue-05c94a4d.js +1 -0
- package/dist/viewport-client/_static/TextBaseComponent-69233798.js +11 -0
- package/dist/viewport-client/_static/TextRendererComponent-130b4e99.js +1 -0
- package/dist/viewport-client/_static/TextureAsset-28fedf2a.js +36 -0
- package/dist/viewport-client/_static/ThumbnailMixin-35997457.js +1 -0
- package/dist/viewport-client/_static/ThumbnailRegistry-495c18c9.js +1 -0
- package/dist/viewport-client/_static/Tooltip-33f770ba.js +1 -0
- package/dist/viewport-client/_static/TrailRendererComponent-148550b5.js +1 -0
- package/dist/viewport-client/_static/TransformBaseComponent-02318c5a.js +1 -0
- package/dist/viewport-client/_static/TransformComponent-96106065.js +1 -0
- package/dist/viewport-client/_static/ViewerManager-202b570a.js +1 -0
- package/dist/viewport-client/_static/XRReferenceImageAsset-6a6adb3b.js +1 -0
- package/dist/viewport-client/_static/assetEditorActions-c4e5962f.js +1 -0
- package/dist/viewport-client/_static/audio-244358e2.js +1 -0
- package/dist/viewport-client/_static/bundlers-9b0d37fc.js +1 -0
- package/dist/viewport-client/_static/createOnModelChange-b57a0da8.js +1 -0
- package/dist/viewport-client/_static/encode-ac4bb64e.js +1 -0
- package/dist/viewport-client/_static/enum-58295f88.js +1 -0
- package/dist/viewport-client/_static/glTFIO-45ff9a17.js +1 -0
- package/dist/viewport-client/_static/index-0a8702e2.js +11217 -0
- package/dist/viewport-client/_static/index-237c84cd.js +20 -0
- package/dist/viewport-client/_static/index-37c74ae9.js +26 -0
- package/dist/viewport-client/_static/index-4cca0201.js +1 -0
- package/dist/viewport-client/_static/index-59732f86.js +1 -0
- package/dist/viewport-client/_static/index-6c8198f6.js +2 -0
- package/dist/viewport-client/_static/index-6f827618.js +1 -0
- package/dist/viewport-client/_static/index-803ca489.js +1 -0
- package/dist/viewport-client/_static/index-85a6cf6a.js +1 -0
- package/dist/viewport-client/_static/index-98982ce2.js +1 -0
- package/dist/viewport-client/_static/index-b3d51f87.js +1 -0
- package/dist/viewport-client/_static/index-be6bc38a.js +177 -0
- package/dist/viewport-client/_static/index-c403cbcd.js +1 -0
- package/dist/viewport-client/_static/index-e46ec5b1.js +16 -0
- package/dist/viewport-client/_static/index-e73966ae.js +1 -0
- package/dist/viewport-client/_static/index-e95b4498.js +1 -0
- package/dist/viewport-client/_static/index-f5a67a46.js +1 -0
- package/dist/viewport-client/_static/ktx-parse.modern-6c9f771f.js +1 -0
- package/dist/viewport-client/_static/ktx2-encoder-1e63c1eb.js +1 -0
- package/dist/viewport-client/_static/ktx2-worker-a04f41ea.js +1 -0
- package/dist/viewport-client/_static/meshopt_simplifier.module-cd99529d.js +1 -0
- package/dist/viewport-client/_static/module-107b7430.js +56 -0
- package/dist/viewport-client/_static/module-5c85b07e.js +1 -0
- package/dist/viewport-client/_static/module-6406b050.js +1 -0
- package/dist/viewport-client/_static/postmen-45d4c238.js +1 -0
- package/dist/viewport-client/_static/scriptPropertyActions-d3a583d2.js +1 -0
- package/dist/viewport-client/_static/utilities-e09052e3.js +11 -0
- package/dist/viewport-client/index.html +20 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var c=(o,e,t)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{L as g}from"./module-6406b050.js";import{E as b,p as l,C as a,s}from"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import{c as P}from"./Component-f923abb1.js";import"./postmen-45d4c238.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";var d=Object.defineProperty,L=Object.getOwnPropertyDescriptor,n=(o,e,t,m)=>{for(var i=m>1?void 0:m?L(e,t):e,y=o.length-1,u;y>=0;y--)(u=o[y])&&(i=(m?u(e,t,i):u(i))||i);return m&&i&&d(e,t,i),i};let r=class extends b{constructor(e,t){super(e,t);p(this,"resource",null);p(this,"autoPlay",!0);p(this,"isLooping",!0);p(this,"speed",1);p(this,"priority",0)}};n([l({label:"lottie.resource.label",info:"lottie.resource.info",type:a.AssetPicker,assetType:"Lottie",bindPath:"resource"}),s()],r.prototype,"resource",2);n([l({label:"lottie.auto-play.label",info:"lottie.auto-play.info",type:a.Toggle,bindPath:"autoPlay",onChange(o,e,t){t||o.engineObject.pause()}}),s()],r.prototype,"autoPlay",2);n([l({label:"lottie.is-looping.label",info:"lottie.is-looping.info",type:a.Toggle,bindPath:"isLooping"}),s()],r.prototype,"isLooping",2);n([l({label:"lottie.speed.label",info:"lottie.speed.info",type:a.Number,dragStep:.01,bindPath:"speed"}),s()],r.prototype,"speed",2);n([l({label:"lottie.priority.label",info:"lottie.priority.info",type:a.Number,bindPath:"priority"}),s()],r.prototype,"priority",2);r=n([P({type:"LottieAnimation",external:!0,componentsMenu:{group:"2D",label:"component.lottie-animation.title"}})],r);b.registerCustomEngineComponent("LottieAnimation",g);export{r as LottieAnimationComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Q=Object.defineProperty;var X=(a,s,t)=>s in a?Q(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var c=(a,s,t)=>(X(a,typeof s!="symbol"?s+"":s,t),t);import{j as E,aH as Y,aU as q,aD as x,e1 as D,e2 as Z,aT as k,aJ as $,aV as tt,aK as et,aI as st,aL as it,ce as L,o as at,S as ot,u as P,J as W,an as B,a0 as M,e as m,_ as rt,cb as V,p as v,C as _,b0 as I,n as nt,cd as F}from"./index-0a8702e2.js";import{L as J}from"./module-6406b050.js";import{a as H,u as lt,A as pt}from"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import{c as ct}from"./SpriteAsset-9a31ec24.js";import{n as R}from"./index-be6bc38a.js";import{A as mt}from"./AssetViewer-bc198e16.js";import{c as G,S as ut}from"./SpriteAtlasAsset-a862db46.js";import{c as dt}from"./TextureAsset-28fedf2a.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./meshopt_simplifier.module-cd99529d.js";import"./bundlers-9b0d37fc.js";import"./FormItemArray-66be8701.js";import"./Accordion-4897319b.js";import"./utilities-e09052e3.js";import"./enum-58295f88.js";import"./encode-ac4bb64e.js";import"./Tooltip-33f770ba.js";import"./ktx2-encoder-1e63c1eb.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";var ht=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,yt=(a,s,t,e)=>{for(var i=e>1?void 0:e?ft(s,t):s,o=a.length-1,r;o>=0;o--)(r=a[o])&&(i=(e?r(s,t,i):r(i))||i);return e&&i&&ht(s,t,i),i};let z=class extends E{initByMain(a,s){return Promise.resolve()}};z=yt([H({type:"LottieAnimation",async bundle(a){const s=JSON.parse(await a.content.text());return{content:new Blob([JSON.stringify(s)])}}})],z);const gt=Y("div",{display:"grid",columnGap:"$1",gridColumn:2/-1,gridTemplateColumns:"minmax(0, 4fr) repeat(1, 2fr) repeat(1, auto) repeat(1, 2fr) repeat(1, auto)",marginBottom:"$1"}),wt=function({clip:a,removeClip:s,onClipChange:t}){const{t:e}=q();return x.jsxs(gt,{children:[x.jsx(D,{size:"sm",value:a.name??"",placeholder:e("lottie.clip.name"),onChange:i=>{t({name:i.currentTarget.value})}}),x.jsx(D,{size:"sm",value:a.start??"",placeholder:e("lottie.clip.start"),onChange:i=>{t({start:+i.currentTarget.value})}}),x.jsx(Z,{width:12,onClick:s}),x.jsx(D,{size:"sm",value:a.end??"",placeholder:e("lottie.clip.end"),onChange:i=>{t({end:+i.currentTarget.value})}})]})},bt=k(function(a){const s=a.model,t=s.getViewer(),{inspectorFacade:e}=lt(),{t:i}=q(),[o,r]=$.useState(()=>Array.isArray(s.clips)?[...s.clips]:[]);$.useEffect(()=>{r(Array.isArray(s.clips)?[...s.clips]:[])},[s,s.clips]),$.useEffect(()=>{t==null||t.setClips(o)},[o,t]);const p=n=>{r(n),e.assetChange(s.id,"clips",n,"asset-meta")},l=()=>{p([...o,{}])},d=n=>{n<0||n>=o.length||p(o.filter((u,y)=>y!==n))},h=(n,u)=>{if(n<0||n>=o.length)return;const y={...o[n],...u},C=o.map((A,b)=>b===n?y:A);p(C)};return x.jsxs(tt,{title:i("lottie.clips.title"),defaultOpen:!0,collapsible:!0,children:[o.map((n,u)=>x.jsx(wt,{clip:n,removeClip:()=>d(u),onClipChange:y=>h(u,y)},`${s.id}-${u}`)),x.jsx(et,{align:"h",css:{margin:"0 auto",padding:"$1 0 0 0"},children:x.jsx(st,{size:"sm",variant:"soft",startSlot:x.jsx(it,{size:"14px"}),onClick:l,children:i("lottie.clips.add")})})]})});async function vt(a,s,t={}){try{const e=JSON.parse(a),{assets:i}=e,o=[];for(let p=0,l=i.length;p<l;p++){const d=i[p],{p:h}=d;h&&o.push({name:d.id,src:h})}const r=await ct(o,{width:2048,height:2048,...t});return r.code!==0?(console.log("Atlas Error:",r.msg),r):(e.assets=i.filter(p=>!p.p),r.info.jsonFile=JSON.stringify(e),r)}catch{return{code:11,msg:"Parse lottie file error"}}}async function xt(a){const s={uploadFiles:[],errors:[]};for(const t in a){const e=a[t],i=e.name;if(i.endsWith(".json"))try{const o=await e.text(),r=JSON.parse(o);_t(r)&&s.uploadFiles.push({main:e})}catch(o){s.errors.push(K(i,o))}}return s}async function Mt(a,s,t){const e=a.main,i=await e.text();let o;try{o=JSON.parse(i)}catch(l){return console.error(l),R.error(K(e.name,l)),e}const{nm:r}=o,p=await vt(i);if(p.code===0)try{const{imageFiles:l,atlasFile:d,jsonFile:h}=p.info,n=JSON.parse(d),{atlasItems:u}=n,y=u.length,C=Ct(),A=St(r,e.name),b=[];for(let g=0;g<y;++g)l[g]&&b.push(L.uploadBlob(`${A}-${C}-${g}.png`,new Blob([l[g]])));const U=await Promise.all(b);for(let g=0;g<y;++g)u[g].img=U[g].url;const[S,T]=await Promise.all([L.uploadBlob(`${A}-${C}.atlas`,new Blob([JSON.stringify(n)])),L.uploadBlob(`${A}-${C}.json`,new Blob([h]))]),N={jsonUrl:T.url,atlasUrl:S.url};return new File([JSON.stringify(N)],e.name)}catch(l){console.error(l),R.error(`parse lottie file fail ${l}`)}else console.error(p.msg),R.error(p.msg);return e}function _t(a){return a.nm&&a.w&&a.h&&a.assets&&a.assets.length>0&&a.layers&&a.layers.length>0}function Ct(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2,10)}function St(a,s){const t=s.replace(/\.[^.]+$/,"")||"lottie";return(typeof a=="string"&&a.length>0?a:t).trim().replace(/[^\w.-]+/g,"_")||"lottie"}function K(a,s){const t=s instanceof Error?s.message:String(s);return`Failed to parse JSON file "${a}": ${t}`}var jt=Object.defineProperty,At=Object.getOwnPropertyDescriptor,O=(a,s,t,e)=>{for(var i=e>1?void 0:e?At(s,t):s,o=a.length-1,r;o>=0;o--)(r=a[o])&&(i=(e?r(s,t,i):r(i))||i);return e&&i&&jt(s,t,i),i};class j extends mt{constructor(){super();c(this,"lottie");c(this,"_updateComponent");c(this,"_lottieAsset");c(this,"playing",!1);c(this,"frameTime",0);c(this,"animationNames",[]);c(this,"animationIndex",0);c(this,"_hasClips",!1);at(this)}get duration(){const{_lottieAsset:t}=this;return this._hasClips&&t.clips[this.animationIndex]?t.clips[this.animationIndex].end-t.clips[this.animationIndex].start:this._lottieAsset.duration}_setAnimationNames(t){this.animationNames=this._hasClips?t==null?void 0:t.map(e=>e.name):[this._lottieAsset.engineObject.name]}setViewAsset(t,e){const i=t.engineObject,o=e.createChild("lottie_entity"),r=o.addComponent(J);this._entity=o,this.lottie=r,r.resource=i,this._lottieAsset=t,this._hasClips=t.clips&&t.clips.length>0,this._setAnimationNames(t.clips),this.animationIndex=0;const p=this;this._updateComponent=this._entity.addComponent(class extends ot{onUpdate(l){p._onUpdate()}}),this.frameTime=0}getSize(){var t;if((t=this.lottie)!=null&&t.resource){const{width:e,height:i}=this.lottie.resource;return{width:e/100,height:i/100}}return{width:0,height:0}}stopViewAsset(){var t;super.stopViewAsset(),this.lottie=null,(t=this._updateComponent)==null||t.destroy(),this.animationNames=null}setClips(t){this.lottie.resource.setClips(t),this._setAnimationNames(t)}play(t){this.lottie.isLooping=!0,this.lottie.play(t),this.playing=!0}pauseAnimation(){this.lottie.pause(),this.playing=!1}selectAnimation(t){this.animationIndex=t;const e=this._lottieAsset.clips[t];this.play(e==null?void 0:e.name)}playAnimation(){const t=this._lottieAsset.clips[this.animationIndex];this.play(t==null?void 0:t.name)}setFrameTime(t){}_onUpdate(){this.playing&&(this.frameTime=this.lottie.frame)}}O([P],j.prototype,"playing",2);O([P],j.prototype,"frameTime",2);O([P],j.prototype,"animationNames",2);O([P],j.prototype,"animationIndex",2);O([W],j.prototype,"play",1);O([W],j.prototype,"pauseAnimation",1);O([W],j.prototype,"_onUpdate",1);var It=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,w=(a,s,t,e)=>{for(var i=e>1?void 0:e?Ot(s,t):s,o=a.length-1,r;o>=0;o--)(r=a[o])&&(i=(e?r(s,t,i):r(i))||i);return e&&i&&It(s,t,i),i};let f=class extends E{constructor(s){super(s);c(this,"textureSet",new Set);c(this,"width",0);c(this,"height",0);c(this,"duration",0);c(this,"inPoint",0);c(this,"outPoint",0);c(this,"clips",[]);c(this,"mipmap",!1);c(this,"colorDilate",!1);c(this,"filterMode",B.Bilinear);c(this,"wrapModeU",M.Repeat);c(this,"wrapModeV",M.Repeat);c(this,"runtimeOptions",{overwrite:!1,textureType:"ktx2",mode:"ETC1S",quality:150,isNormal:!1});this.formSchema.addGroup(m("lottie.asset.atlas-export"),["filterMode","wrapModeU","wrapModeV","mipmap","colorDilate"])}destroy(){super.destroy(),this.textureSet.clear(),this.textureSet=null}async initByUploadFile(s){return await this._initByUrl(this.engine,s),this}async initByMain(s){const{engine:t,meta:e}=this;e.runtimeOptions&&(this.runtimeOptions=e.runtimeOptions),this.clips=e.clips||[],this.filterMode=e.filterMode??this.filterMode,this.wrapModeU=e.wrapModeU??this.wrapModeU,this.wrapModeV=e.wrapModeV??this.wrapModeV,this.mipmap=e.mipmap??this.mipmap,this.colorDilate=e.colorDilate??this.colorDilate,await this._initByUrl(t,s);const i=new rt(this.engine),o=i.addComponent(J);o.resource=this.engineObject,this.setDragTempEntity(i)}instantiate(){const s=this.root.sceneStore.createEntity(),t=this.getDragTempEntity(),{position:e,rotation:i}=t.transform,o={components:[{class:"LottieAnimation",id:V(),props:{resource:this.getCurrentRef(),priority:0,defaultState:{}}}],id:s.id,isActive:!0,isClone:!1,name:this.name?this.name:"lottie",transform:{class:"Transform",props:{position:{x:e.x,y:e.y,z:e.z},rotation:{x:i.x,y:i.y,z:i.z},scale:{x:1,y:1,z:1}}}};return s.initByFile(o),s}async _createLottieResource(s,t,e){return(await s.resourceManager.load({urls:[t,e],type:"lottie"})).getComponent(J).resource}async _initByUrl(s,t){const e=JSON.parse(await t.text()),{jsonUrl:i,atlasUrl:o}=e,r=await this._createLottieResource(s,i,o);this.bindEngineObject(r);const{sprites:p}=r.atlas,{textureSet:l}=this;for(let d=0,h=p.length;d<h;++d){const n=p[d].texture;l.has(n)||(l.add(n),n.filterMode=this.filterMode,n.wrapModeU=this.wrapModeU,n.wrapModeV=this.wrapModeV)}return this.width=r.width,this.height=r.height,this.duration=r.duration,this.inPoint=r.inPoint,this.outPoint=r.outPoint,this}};w([v({type:_.Input,disabled:!0,label:m("lottie.asset.width")})],f.prototype,"width",2);w([v({type:_.Input,disabled:!0,label:m("lottie.asset.height")})],f.prototype,"height",2);w([v({type:_.Input,disabled:!0,label:m("lottie.asset.duration")})],f.prototype,"duration",2);w([v({type:_.Input,disabled:!0,label:m("lottie.asset.in-point")})],f.prototype,"inPoint",2);w([v({type:_.Input,disabled:!0,label:m("lottie.asset.out-point")})],f.prototype,"outPoint",2);w([v({disabled:!0,customComponent:bt}),I()],f.prototype,"clips",2);w([v({label:m("lottie.asset.mipmap"),type:_.Toggle}),I()],f.prototype,"mipmap",2);w([v({label:m("lottie.asset.color-dilate"),type:_.Toggle}),I()],f.prototype,"colorDilate",2);w([v({label:m("lottie.asset.filter-mode.title"),type:_.Select,value:B.Bilinear,options:[{label:m("lottie.asset.filter-mode.point"),value:B.Point},{label:m("lottie.asset.filter-mode.bilinear"),value:B.Bilinear},{label:m("lottie.asset.filter-mode.trilinear"),value:B.Trilinear}],onChange(a,s,t){const{textureSet:e}=a;e.forEach(i=>{i.filterMode=t})}}),I()],f.prototype,"filterMode",2);w([v({label:m("lottie.asset.wrap-mode.u"),type:_.Select,value:M.Repeat,options:[{label:m("lottie.asset.wrap-mode.clamp"),value:M.Clamp},{label:m("lottie.asset.wrap-mode.repeat"),value:M.Repeat},{label:m("lottie.asset.wrap-mode.mirror"),value:M.Mirror}],onChange(a,s,t){const{textureSet:e}=a;e.forEach(i=>{i.wrapModeU=t})}}),I()],f.prototype,"wrapModeU",2);w([v({label:m("lottie.asset.wrap-mode.v"),type:_.Select,value:M.Repeat,options:[{label:m("lottie.asset.wrap-mode.clamp"),value:M.Clamp},{label:m("lottie.asset.wrap-mode.repeat"),value:M.Repeat},{label:m("lottie.asset.wrap-mode.mirror"),value:M.Mirror}],onChange(a,s,t){const{textureSet:e}=a;e.forEach(i=>{i.wrapModeV=t})}}),I()],f.prototype,"wrapModeV",2);w([P,I()],f.prototype,"runtimeOptions",2);f=w([H({type:"Lottie",label:m("asset.lottie.title"),loaderType:"EditorLottie",importMenuConfig:{type:pt.Upload,accept:".json"},viewer:j,filterUploadFiles:xt,preUpload:Mt,dragLayer:nt.Lottie,customInspector:dt,async bundle(a,s,t){var N,g;const e=JSON.parse(await a.content.text()),i=a.meta,{jsonUrl:o,atlasUrl:r}=e,p=F(a.name).split(".")[0],l=a.dependencies||(a.dependencies=[]),d=t.vfs,h=((N=l[0])==null?void 0:N.ref.refId)??V();let n;l[0]||(l[0]={key:"atlasUrl",ref:{refId:h}});let u=d.getFileById(h);u?n=u.meta:(n=G(h,E.getRegisteredAssetMeta(ut).type,s,{ignorePack:!0}),t.addFile({name:p+"_atlas.atlas",assetId:h,url:null,parentId:a.parentId,main:null,meta:n}),u=d.getFileById(h),u.ignoreBundle=!0),n.colorDilate=i.colorDilate,n.filterMode=i.filterMode,n.wrapModeU=i.wrapModeU,n.wrapModeV=i.wrapModeV,n.mipmap=i.mipmap;const y=a.meta.runtimeOptions;let C=s.assetOptions.textureOptions;y!=null&&y.overwrite&&(C=Object.assign({},C,y)),n.runtimeOptions=C;const A=await(await fetch(r)).json();t.updateFile(h,{main:new Blob([JSON.stringify(A)]),meta:n}),await t.bundleSingleFile(u,s),e.atlasUrl="./"+F(u.exportPath);const b=((g=l[1])==null?void 0:g.ref.refId)??V();let U;l[1]||(l[1]={key:"jsonUrl",ref:{refId:b}});let S=d.getFileById(b);S?U=S.meta:(U=G(b,E.getRegisteredAssetMeta(z).type,s),t.addFile({name:p+"_clip.json",assetId:b,url:null,parentId:a.parentId,main:null,meta:U}),S=d.getFileById(b),S.ignoreBundle=!0);const T=await(await fetch(o)).json();return T.lolitaAnimations=i.clips,t.updateFile(b,{main:new Blob([JSON.stringify(T)])}),await t.bundleSingleFile(S,s),e.jsonUrl="./"+F(S.exportPath),{content:new Blob([JSON.stringify(e)])}}})],f);export{f as LottieAsset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=Object.defineProperty;var c=(e,t,o)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var p=(e,t,o)=>(c(e,typeof t!="symbol"?t+"":t,o),o);import{j as u,o as d,q as b,u as f,e as h}from"./index-0a8702e2.js";import{a as w,A as y}from"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";var v=Object.defineProperty,D=Object.getOwnPropertyDescriptor,m=(e,t,o,n)=>{for(var r=n>1?void 0:n?D(t,o):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(r=(n?i(t,o,r):i(r))||r);return n&&r&&v(t,o,r),r};let a=class extends u{constructor(t){super(t);p(this,"content","");d(this),this.onDoubleClick=this.onDoubleClick.bind(this)}async initByMain(t){this.content=await t.text()}async initByCreation(){return""}getMainData(){return this.content}onDoubleClick(){b(this.root.projectStore.id,this.id)}};m([f],a.prototype,"content",2);a=m([w({type:"Markdown",label:h("asset.markdown.title"),defaultName:"Document.md",extname:"md",importMenuConfig:{type:y.Add},bundle({content:e}){return{content:new Blob([e],{type:"text/markdown; charset=utf-8"})}}})],a);export{a as MarkdownAsset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var G=Object.defineProperty;var K=(p,e,t)=>e in p?G(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var l=(p,e,t)=>(K(p,typeof e!="symbol"?e+"":e,t),t);import{O as V,b$ as k,cQ as L,cR as U,I as Q,H as z,V as H,x as W,cS as f,j as J,n as $,cT as v,F as M,o as q,cU as x,G as I,ab as b,ac as O,cK as Y,C as P,cV as E,cW as X,w as S,cO as Z,e as w,bU as ee,_ as te,ao as ae,ap as re,B,a8 as se,Q as ne,u as N,J as m}from"./index-0a8702e2.js";import{a as ie,A as oe}from"./InstanceEditorAsset-a70e73fe.js";import"./AssetPreviewer-24e31d97.js";import{M as he}from"./MaterialInspector-aec1248b.js";import{A as pe}from"./AssetViewer-bc198e16.js";import{E as y,s as F,b as C}from"./ProxyConfigs-4de3304c.js";async function de(p){var e;if(p.shaderRef)try{const t=await p.assetStore.getAssetByRef(p.shaderRef);if(!t||t===p.nextShaderAsset)return;(e=t.removeReferencedMaterial)==null||e.call(t,p.material)}catch{}}class ce extends pe{constructor(){super(...arguments);l(this,"_sphereRenderer",null);l(this,"_particleRenderer",null);l(this,"_asset",null);l(this,"_shaderReactionDisposer",null);l(this,"onShaderChange",()=>{const{_asset:t}=this;t.engineObject.shader.name==="particle-shader"?(this._particleRenderer.entity.isActive=!0,this._sphereRenderer.entity.isActive=!1,this._particleRenderer.setMaterial(t.engineObject)):(this._particleRenderer.entity.isActive=!1,this._sphereRenderer.entity.isActive=!0,this._sphereRenderer.setMaterial(t.engineObject))})}setViewAsset(t,a){if(!(t instanceof u))return;const n=a.createChild("material");this._asset=t;const r=this._sphereRenderer=n.createChild("mat").addComponent(V);r.mesh=k.createSphere(a.engine,1,32,!0);const o=this._particleRenderer=n.createChild("pat").addComponent(L);o.generator.main.duration=1e3,o.generator.main.startSpeed.constant=0,this._entity=n,a.addChild(this._entity),this.onShaderChange(),this._shaderReactionDisposer=U(()=>{var i,d;return(d=(i=this._asset)==null?void 0:i.shaderRef)==null?void 0:d.refId},()=>{this.onShaderChange()})}stopViewAsset(){var t;super.stopViewAsset(),(t=this._shaderReactionDisposer)==null||t.call(this),this._shaderReactionDisposer=null,this._asset=null}}class D{static update(e,t){if(!(t instanceof u))return;const a=t.engineObject;if(!a||!a.shader){this.entity&&this.sphereRenderer&&this.particleRenderer&&this.clear();return}this.entity?this.entity.isActive=!0:this.initScene(e),a.shader.name==="particle-shader"?(this.sphereRenderer.entity.isActive=!1,this.particleRenderer.entity.isActive=!0,this.particleRenderer.setMaterial(a),this.particleRenderer.generator._playTime=5):(this.particleRenderer.entity.isActive=!1,this.sphereRenderer.entity.isActive=!0,this.sphereRenderer.setMaterial(a))}static clear(){var e,t;(e=this.sphereRenderer)!=null&&e.entity&&(this.sphereRenderer.entity.isActive=!1),(t=this.particleRenderer)!=null&&t.entity&&(this.particleRenderer.entity.isActive=!1),this.entity&&(this.entity.isActive=!1)}static initScene(e){const t=this.entity=e.createChild("material"),a=this.sphereRenderer=t.createChild("mat").addComponent(V);a.mesh=k.createSphere(e.engine,2,64,!0),this.particleRenderer=t.createChild("pat").addComponent(L),this.particleRenderer.bounds.max.set(.5,.5,.5),this.particleRenderer.bounds.min.set(-.5,-.5,-.5)}}l(D,"entity",null),l(D,"sphereRenderer",null),l(D,"particleRenderer",null);function j(p){return p instanceof Q?{x:p.x,y:p.y}:p instanceof z?{x:p.x,y:p.y,z:p.z}:p instanceof H?{x:p.x,y:p.y,z:p.z,w:p.w}:p instanceof W?{r:p.r,g:p.g,b:p.b,a:p.a}:p}function le(p){switch(p){case f.Color:return"Color";case f.Float:return"Float";case f.Int:return"Integer";case f.Matrix:return"Matrix";case f.Texture:return"Texture";case f.TextureArray:return"TextureArray";case f.Vector2:return"Vector2";case f.Vector3:return"Vector3";case f.Vector4:return"Vector4"}}var ue=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,g=(p,e,t,a)=>{for(var n=a>1?void 0:a?fe(e,t):e,r=p.length-1,o;r>=0;r--)(o=p[r])&&(n=(a?o(e,t,n):o(n))||n);return a&&n&&ue(e,t,n),n};let u=class extends J{constructor(e){super(e);l(this,"acceptDragLayer",$.Texture);l(this,"shaderRef",{refId:null});l(this,"shaderDataKeys",new Set);l(this,"formConfig",null);l(this,"_autoSaveSuppressed",!1);q(this),x(this,{proxyConfigs:[]})}static initBuiltinMaterial(e,t){e.shader=t;const a=e.shaderData;switch(a.disableMacro("MATERIAL_NEED_WORLD_POS"),a.disableMacro("MATERIAL_OMIT_NORMAL"),a.disableMacro("MATERIAL_NEED_TILING_OFFSET"),a.disableMacro("MATERIAL_SUN_HIGH_QUALITY"),e.renderState.depthState.compareFunction=v.Less,t.name){case"unlit":a.enableMacro("MATERIAL_OMIT_NORMAL"),a.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"pbr-specular":case"pbr":case"bake-pbr":case"blinn-phong":a.enableMacro("MATERIAL_NEED_WORLD_POS"),a.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"skybox":e.renderState.rasterState.cullMode=M.Off,e.renderState.depthState.compareFunction=v.LessEqual;break;case"SkyProcedural":a.enableMacro("MATERIAL_SUN_HIGH_QUALITY"),e.renderState.rasterState.cullMode=M.Off,e.renderState.depthState.compareFunction=v.LessEqual;break;case"particle-shader":a.enableMacro("MATERIAL_OMIT_NORMAL");break}}setAutoSaveSuppressed(e){this._autoSaveSuppressed=e}setRenderQueueType(e){this.engineObject.renderState.renderQueueType=e}setBlendStateEnabled(e){this.engineObject.renderState.blendState.targetBlendState.enabled=e}setDepthWriteEnabled(e){this.engineObject.renderState.depthState.writeEnabled=e}setCullMode(e){this.engineObject.renderState.rasterState.cullMode=e}setBlendMode(e){const t=this.engineObject.renderState.blendState.targetBlendState;switch(e){case I.Normal:t.sourceColorBlendFactor=b.SourceAlpha,t.destinationColorBlendFactor=b.OneMinusSourceAlpha,t.sourceAlphaBlendFactor=b.One,t.destinationAlphaBlendFactor=b.OneMinusSourceAlpha,t.colorBlendOperation=O.Add,t.alphaBlendOperation=O.Add;break;case I.Additive:t.sourceColorBlendFactor=b.SourceAlpha,t.destinationColorBlendFactor=b.One,t.sourceAlphaBlendFactor=b.One,t.destinationAlphaBlendFactor=b.OneMinusSourceAlpha,t.colorBlendOperation=O.Add,t.alphaBlendOperation=O.Add;break}}bindShaderAsset(e,t){for(const a of this.shaderDataKeys)this.removePropertyChangeListener(a);return this.shaderDataKeys.clear(),e.onReady().then(async()=>{var n;if(e.shaderScriptRefId){const r=this.root.assetStore.assets[e.shaderScriptRefId.refId];this.isInitCompleted&&(r==null||r.onShaderChange(this._engineObject),t=this._getMainData())}const a=e.properties?Y(e.properties):[];e.isBuiltinShader()&&u.initBuiltinMaterial(this.engineObject,e.engineObject),t=t||this._getMainData(),await this._proxyShaderProps(a,t,this.isInitCompleted),this.refreshFormConfig(a,t),this.refreshAnimatableProperties(a),de({assetStore:this.root.assetStore,shaderRef:this.shaderRef,nextShaderAsset:e,material:this}),e.addReferencedMaterial(this),this.shaderRef={refId:e.id},await this.applyBoundPathChange("shader",P.AssetPicker,this.shaderRef),(n=this.updateThumbnail)==null||n.call(this)})}async _proxyShaderProps(e,t,a=!0){var o;this.proxyConfigs=e;const n=(o=this.extraData)==null?void 0:o.disabledMacros,r=e.map(async i=>{var d;if(this.proxySetter(i),this._virualShaderProps(e),i.bundleType==="macro"){const s=i.macroInfo,h=t.macros.find(c=>c.name===i.prop);if(!E(this,i.prop)){let c;h!=null?(c=h.value,s&&(s.checked=!0)):n!=null&&n.includes(i.prop)?(c=void 0,s&&(s.checked=!1)):c=i.defaultValue,x(this,{[i.prop]:c})}if(a)if(h){const c=h.value??i.defaultValue;c==null?s==null||s.onSwitch(!0,this):await i.onChange(this,i.prop,c)}else!(n!=null&&n.includes(i.prop))&&(s!=null&&s.checked)&&(s==null||s.onSwitch(!0,this))}else{const s=t.shaderData[i.prop];let h=s?s.value:this[i.prop]??i.defaultValue;if(h!=null&&h.refId&&!this.root.assetStore.assets[h.refId]&&(h=void 0),((d=i.uiInfo)==null?void 0:d.type)===y.Color)if(i.uiInfo.mode==="hdr"){const c=h.intensity??1;c!==0&&(h.r/=c,h.g/=c,h.b/=c),h.intensity=c}else h.intensity=1;E(this,i.prop)||x(this,{[i.prop]:h}),a&&this.notifyPropertyChange(i.prop,!1)}});await Promise.all(r)}proxySetter(e){const{prop:t,onChange:a,bundleType:n}=e,r=async(o,i)=>{var s;const d=this._engineObject.shaderData;n==="macro"?d.enableMacro(t,o):await F(this,t,o,e.engineType??((s=e.uiInfo)==null?void 0:s.type)),await a(this,t,o),i!==!1&&!this._autoSaveSuppressed&&(await this.root.assetFacade.persistAssetMain(this.id),this.updateThumbnail())};this.addPropertyChangeListener(t,r),this.shaderDataKeys.add(t)}_virualShaderProps(e){const t=this;e.forEach(a=>{X(t,a.prop)})}refreshFormConfig(e,t){var n,r,o,i,d;const a={root:[],groups:{}};if(t){for(const s of e)if(!((n=s.uiInfo)!=null&&n.hide)){if((r=s.uiInfo)!=null&&r.group){if((o=s.uiInfo)!=null&&o.group){let h=a.groups[s.uiInfo.group];h||(h={type:P.Group,property:s.uiInfo.group,children:[]},a.groups[s.uiInfo.group]=h);const c=s.uiInfo;c.property=s.prop,s.macroInfo&&(c.macroConfig=s.macroInfo),h.children.push(c)}}else{const h=s.uiInfo;h.property=s.prop,s.macroInfo&&(h.macroConfig=s.macroInfo),a.root.push(h)}s.bundleType==="macro"?this[s.prop]=((i=t.macros.find(h=>h.name===s.prop))==null?void 0:i.value)??s.defaultValue:this[s.prop]=((d=t.shaderData[s.prop])==null?void 0:d.value)??s.defaultValue}}this.formConfig=a}refreshAnimatableProperties(e){var t,a,n;this._additionAnimatableProperties.length=0;for(const r of e){if(!r.uiInfo||r.uiInfo.hide||r.bundleType==="macro")continue;let o={};if((r.setPath||r.getPath||r.valueType||r.interpolationType)&&(o={setPath:r.setPath,getPath:r.getPath,valueType:r.valueType,interpolationType:r.interpolationType}),!o.setPath&&!o.getPath&&r.engineType&&(r.bundleType==="shaderData"||!r.bundleType))switch(r.engineType){case y.Float:o={setPath:`shaderData.setFloat('${r.prop}', $value)`,getPath:`shaderData.getFloat('${r.prop}')`,valueType:S.Float};break;case y.Integer:o={setPath:`shaderData.setInt('${r.prop}', $value)`,getPath:`shaderData.getInt('${r.prop}')`,valueType:S.Float,interpolationType:Z.Step};break;case y.Vector2:o={setPath:`shaderData.getVector2('${r.prop}')`,getPath:`shaderData.getVector2('${r.prop}')`,valueType:S.Vector2};break;case y.Vector3:o={setPath:`shaderData.getVector3('${r.prop}')`,getPath:`shaderData.getVector3('${r.prop}')`,valueType:S.Vector3};break;case y.Vector4:o={setPath:`shaderData.getVector4('${r.prop}')`,getPath:`shaderData.getVector4('${r.prop}')`,valueType:S.Vector4};break;case y.Color:o={setPath:`shaderData.getColor('${r.prop}')`,getPath:`shaderData.getColor('${r.prop}')`,valueType:S.Color};break;case y.Boolean:o={setPath:`shaderData.setBoolean('${r.prop}', $value)`,getPath:`shaderData.getBoolean('${r.prop}')`,valueType:S.Boolean};break;case y.Texture:o={setPath:`shaderData.setTexture('${r.prop}', $value)`,getPath:`shaderData.getTexture('${r.prop}')`,valueType:S.ReferResource};break}if(!o.setPath&&!o.getPath){if(r.bundleType==="other")continue;continue}this._additionAnimatableProperties.push({property:r.prop,label:(t=r.uiInfo)!=null&&t.label?w(r.uiInfo.label):r.prop,type:(a=r.uiInfo)==null?void 0:a.type,propertyProxyConfig:o}),(n=r.uiInfo)!=null&&n.label&&(o.label=w(r.uiInfo.label)),ee(this,r.prop,o)}}async initByMain(e){var c;const t=JSON.parse(await e.text());this.shaderRef=t.shaderRef;const a=t.shaderData,n=t.macros,r=t.renderState;if(!t.shaderRef)throw"invalid material";const o=new te(this.engine);this.setDragTempEntity(o);const i=await this.root.assetStore.getAssetByRef(t.shaderRef),d=i.engineObject??ae.find("unlit"),s=new re(this.engine,d);this.bindEngineObject(s);const h=s.shaderData;if(n)for(const R of n)h.enableMacro(R.name,R.value);if(a)for(const R in a){const _=a[R];let A=_.value;if(_.type===y.Color){A={..._.value};const T=_.value.intensity??1;T!==0&&(A.r/=T,A.g/=T,A.b/=T)}F(this,R,A,_.type)}r&&this._parseProperty(s,"renderState",r),await this.bindShaderAsset(i,t),(c=this.updateThumbnail)==null||c.call(this),await this.applyBoundPathChange("name",P.Input,this.name),this._checkSchemaOnInit(t,i)}_checkSchemaOnInit(e,t){e.shader!==t.engineObject.name&&this.root.assetFacade.persistAssetMain(this.id)}initByEngineObject(e){const t=this;this.bindEngineObject(e),t.shader=e.shader.name,t._name=e.name??"";const n=Object.values(this.root.assetStore.assets).filter(d=>d.meta.type==="Shader"&&!!d.meta.builtinShaderName).find(d=>d.meta.builtinShaderName===e.shader.name);switch(this.shaderRef={refId:n.id},t.isTransparent=e.renderState.blendState.targetBlendState.enabled,t.alphaCutoff=e.shaderData.getFloat("material_AlphaCutoff"),e.renderState.rasterState.cullMode){case M.Back:t.renderFace=B.Front;break;case M.Front:t.renderFace=B.Back;break;case M.Off:t.renderFace=B.Double;break}t.blendMode=e.renderState.blendState.targetBlendState.destinationColorBlendFactor===b.One?I.Additive:I.Normal;const r=e.shaderData;r.getProperties().forEach(d=>{const s=r.getPropertyValue(d);if(s instanceof se){const h=this.root.assetStore.engineObjectToAssetMap.get(s);this[d.name]=h==null?void 0:h.getCurrentRef()}else this[d.name]=j(s)});const i=this._getMainData();this._proxyShaderProps(C,i,!1),this.bindShaderAsset(n,i)}afterDelete(){var e;(e=this.engineObject)==null||e.destroy(!0)}rename(e){return this.root.assetFacade.persistAssetMain(this.id),super.rename(e)}_getMainData(e){var i,d;const t=[],a=(e??this.engineObject).shaderData;a.getMacros(t);const n=t.map(({name:s,value:h})=>h===void 0?{name:s}:{name:s,value:h}),r=[],o={};a.getProperties(r);for(const s of r){let h;if(s.type===f.Texture||s.type===f.TextureArray)h=this[s.name];else{const c=a.getPropertyValue(s);h=j(c),((i=this[s.name])==null?void 0:i.intensity)!=null&&(h.intensity=(d=this[s.name])==null?void 0:d.intensity)}h!=null&&(o[s.name]={type:le(s.type),value:h})}return{name:this.name,shader:this.engineObject.shader.name,macros:n,renderState:this.engineObject.renderState,shaderData:o,shaderRef:this.shaderRef}}getMainData(){return JSON.stringify(this._getMainData())}async initByCreation(){var o;const e=new ne(this.engine),t=[];e.shaderData.getMacros(t);const a=t.map(({name:i,value:d})=>d===void 0?{name:i}:{name:i,value:d});this.bindEngineObject(e);const n={};for(const i of C)i.defaultValue&&(n[i.prop]={value:i.defaultValue,type:i.engineType??((o=i.uiInfo)==null?void 0:o.type)});const r={shaderData:n,shaderRef:{refId:"0000501"},name:this.name,shader:e.shader.name,macros:a,renderState:e.renderState};return this._proxyShaderProps(C,r,!1),r}async onSubAssetEdit(){var n;const e=await this.root.assetFacade.createAssetByAdd({assetType:"Material",name:`${this._name}-copied`});this.engineObject.cloneTo(e.engineObject),await e.applyBoundPathChange("name",P.Input,e.name),e.initByEngineObject(e.engineObject),e.updateThumbnail(),await this.root.assetFacade.persistAssetMain(e.id);const t=await this.root.assetStore.getAssetByRef({refId:this.mainId}),a=((n=t.engineObject.materials)==null?void 0:n.indexOf(this._engineObject))??-1;a>=0&&await t.replaceMaterial(a,e.getCurrentRef()),this.root.assetStore.selectAsset(e.id)}saveMainImmediately(){return!this.engineObject||!this.engineObject.shaderData?Promise.resolve(void 0):(this.root.projectStore.setSyncStatus("syncing"),super.saveMainImmediately().then(e=>(e&&this.root.projectStore.setSyncStatus("success"),e)).catch(e=>{throw this.root.projectStore.setSyncStatus("error"),e}))}_parseProperty(e,t,a){if(typeof a=="object")for(const n in a)this._parseProperty(e[t],n,a[n]);else e[t]=a}async _onDrop(e,t){const a="material_BaseTexture";if(a in this){const n=t.getCurrentRef();this[a]=n;const r=C.find(o=>o.prop===a);r&&await r.onChange(this,a,n),await this.root.assetFacade.persistAssetMain(this.id)}this.dropping=!1}async onDropToViewport(){const{sceneStore:e,sceneUIStore:t}=this.root,a=t.hoveredEntityId;if(a){const n=e.entities.get(a);if(n){const r=n.getComponentByTypeName("MeshRenderer"),o=n.getComponentByTypeName("SkinnedMeshRenderer"),i=r||o;i&&this.root.componentFacade.updateComponent(n.id,i.id,{material:this.getCurrentRef()})}}this.root.projectStore.currentViewport.viewport.onDrop()}};g([N],u.prototype,"shaderRef",2);g([N.ref],u.prototype,"formConfig",2);g([m],u.prototype,"bindShaderAsset",1);g([m],u.prototype,"_proxyShaderProps",1);g([m],u.prototype,"proxySetter",1);g([m],u.prototype,"_virualShaderProps",1);g([m],u.prototype,"refreshAnimatableProperties",1);g([m],u.prototype,"_onDrop",1);u=g([ie({type:"Material",label:w("asset.material.title"),loaderType:"Material",extname:"mat",importMenuConfig:{type:oe.Add},customInspector:he,viewer:ce,thumbnail:D,dragLayer:$.Material})],u);const Ae=Object.freeze(Object.defineProperty({__proto__:null,get MaterialAsset(){return u}},Symbol.toStringTag,{value:"Module"}));export{u as M,ce as a,Ae as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A=Object.defineProperty;var L=(d,e,t)=>e in d?A(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var j=(d,e,t)=>(L(d,typeof e!="symbol"?e+"":e,t),t);import{aH as x,aI as N,aT as S,aJ as $,aD as s,aK as M,C as n,bx as V,aE as F,by as B,aY as f,aU as E,bz as T,e as z}from"./index-0a8702e2.js";import{u as W}from"./InstanceEditorAsset-a70e73fe.js";import"./AssetPreviewer-24e31d97.js";import{I as O}from"./IconPointFilled-a304fd34.js";const U=x(O,{marginRight:"-$1",variants:{checked:{true:{color:"$green10"}}}}),H=x(N,{width:"100%",border:"none",position:"relative",whiteSpace:"pre-wrap",boxShadow:"$2","& > svg":{marginRight:"$1"}});function b(d){return S(function(t){const{inspectorConfig:r,macroConfig:c,...p}=t,{model:i}=p;let{models:g}=p;const{checked:u,onSwitch:h}=c,{type:m,...a}=r,[o,l]=$.useState(u);$.useEffect(()=>{l(u)},[u]),g=g||[i];const y=()=>{const I=!o;if(h)for(const k of g)h(I,k);l(I)},v=r.label;return s.jsxs(M,{direction:"column",fullWidth:!0,children:[m!==n.Null&&o&&V.createElement(d,{...p,inspectorConfig:{...a,type:m}}),s.jsx(F,{label:o?"":v,children:s.jsx(H,{size:"sm",variant:"subtle",startSlot:s.jsx(U,{size:"12px",checked:o}),onClick:y,children:o?"Enabled ":"Disabled"})})]})})}const J=x(M),K=x(B,{backgroundColor:"$gray1",height:"2px !important"});function Y(d){const{inspectorConfig:e,models:t,onModelChange:r,model:c,macroConfig:p}=d,{type:i,property:g,info:u}=e,{t:h}=E(),m=!c&&t&&t.length>1;if(m&&!t.find(R=>e.when?e.when(R):!0)||e.when&&!e.when(c))return null;const a=p?w.getRegisteredMacroComponent(i):w.getRegisteredComponent(i);if(!a)return console.warn(`缺少${i}类型的组件`),null;let o=e.disabled;!m&&c.getEditable&&(o=c.getEditable(e.property)===!1);const l=typeof e.label=="string"?h(e.label):e.label;let y=e.options;y&&(y=y.map(R=>({label:typeof R.label=="string"?h(R.label):R.label,value:R.value})));const v={...e,label:l,info:u,options:y,disabled:o},{triggerAfterInit:I,customComponent:k,...P}=v;return s.jsx(a,{inspectorConfig:P,macroConfig:p,models:t,model:c,onModelChange:r},g)}const C=class C{static registerComponent(e,t){this.components[e]=t}static getRegisteredComponent(e){return C.components[e]}static getRegisteredMacroComponent(e){return C.macroComponents[e]}};j(C,"components",f.getRegisteredComponents()),j(C,"macroComponents",{[n.Color]:b(f.getRegisteredComponent(n.Color)),[n.Vector4]:b(f.getRegisteredComponent(n.Vector4)),[n.Vector3]:b(f.getRegisteredComponent(n.Vector3)),[n.Vector2]:b(f.getRegisteredComponent(n.Vector2)),[n.Number]:b(f.getRegisteredComponent(n.Number)),[n.AssetPicker]:b(f.getRegisteredComponent(n.AssetPicker)),[n.Boolean]:b(f.getRegisteredComponent(n.Boolean)),[n.Null]:b(f.getRegisteredComponent(n.Null))}),j(C,"Item",S(Y)),j(C,"List",S(function(t){const{configs:r,models:c,css:p,onModelChange:i,model:g,children:u,fullWidth:h=!1,withSeparator:m}=t;return r!=null&&r.length&&r.sort((a,o)=>{const l=a.priority??0;return(o.priority??0)-l}),r?s.jsxs(J,{css:p,className:"shader-inspector-form",fullWidth:h,children:[r.map(a=>s.jsxs($.Fragment,{children:[s.jsx(C.Item,{inspectorConfig:a,macroConfig:a.macroConfig,model:g,models:c,onModelChange:i},a.property),m&&s.jsx(K,{})]},a.property)),u]}):null}));let w=C;const q=x("div",{backgroundColor:"$appBg",width:"100%"}),D=x("div",{backgroundColor:"$panelBg",borderRadius:"0 0 $2 $2",overflow:"hidden",paddingBottom:"$1"}),G=x("div",{width:"100%",backgroundColor:"$gray3",paddingBottom:"$0_5"}),Q=x(B,{backgroundColor:"$appBg",height:"2px !important"}),X=d=>{var a;const{asset:e}=d,t=e.formConfig,{assetStore:r,inspectorFacade:c}=W(),{i18n:p}=E(),i=r.assets[e.shaderRef.refId],g=i==null?void 0:i.name,u=Object.values(r.assets).filter(o=>o.meta.type==="Shader"&&o.meta.utility!=="error"),h=()=>{r.selectAsset(e.shaderRef.refId)},m=(o,l)=>{c.assetChange(e.id,o,l)};if(t.root)for(const o of t.root){const l=o.comments;l&&(o.info=l[p.language]??l.default??void 0)}return s.jsxs(q,{children:[s.jsx(G,{children:s.jsx(T,{label:z("asset.shader.title"),assets:u,disabled:!!(i!=null&&i.isSubAsset)||e.isSubAsset||!e.getEditable(),value:g,dropLayer:0,onSelect:async o=>{await e.bindShaderAsset(o,e._getMainData()),await c.assetChanges(e.id,{shaderRef:e.shaderRef,shader:e.shader})},onLocate:h})}),((a=t.root)==null?void 0:a.length)>0&&s.jsx(D,{children:s.jsx(w.List,{model:e,onModelChange:m,configs:t.root,withSeparator:!1})}),s.jsx(Q,{}),s.jsx(w.List,{model:e,onModelChange:m,configs:Object.values(t.groups)})]})},ne=S(X);export{ne as M};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{aC as Or,aD as i,aH as T,aJ as a,e9 as dt,e3 as Nc,bx as pe,g6 as $c,g7 as Oc,g8 as Dc,g9 as jc,ga as Lc,gb as kc,gc as Fc,gd as Uc,ge as Gc,gf as Kc,dS as k,dU as me,bJ as Ne,bH as $e,bM as ee,eb as ln,ec as Dr,ed as Bc,ee as Wc,ea as Vc,ef as Hc,bI as U,dR as jr,bL as F,bK as y,dT as xt,dV as Lr,dW as Mt,gg as kr,gh as Fr,gi as Ur,gj as Q,gk as Gr,gl as Kr,gm as Br,gn as Wr,go as Vr,gp as Hr,bE as dn,bF as fn,dX as wt,gq as Oe,dY as Yr,dZ as ge,gr as pn,d_ as Xr,gs as mn,d$ as zr,e0 as St,gt as Yc,gu as $t,gv as Ot,gw as Dt,gx as Re,gy as nr,gz as jt,gA as Lt,gB as kt,gC as Ft,gD as Ut,gE as rr,bR as Xc,gF as zc}from"./index-0a8702e2.js";/**
|
|
2
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/var Zc=Or("outline","hand-finger","IconHandFinger",[["path",{d:"M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5",key:"svg-0"}],["path",{d:"M11 11.5v-2a1.5 1.5 0 1 1 3 0v2.5",key:"svg-1"}],["path",{d:"M14 10.5a1.5 1.5 0 0 1 3 0v1.5",key:"svg-2"}],["path",{d:"M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47",key:"svg-3"}]]);/**
|
|
7
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/var qc=Or("outline","hand-two-fingers","IconHandTwoFingers",[["path",{d:"M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5",key:"svg-0"}],["path",{d:"M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47",key:"svg-1"}],["path",{d:"M14 10.5a1.5 1.5 0 0 1 3 0v1.5",key:"svg-2"}],["path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5",key:"svg-3"}]]);const Jc=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M6 7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H14C15.0609 3 16.0783 3.42143 16.8284 4.17157C17.5786 4.92172 18 5.93913 18 7M6 7V17C6 18.0609 6.42143 19.0783 7.17157 19.8284C7.92172 20.5786 8.93913 21 10 21H14C15.0609 21 16.0783 20.5786 16.8284 19.8284C17.5786 19.0783 18 18.0609 18 17V7M6 7V9H18V7"}),i.jsx("path",{d:"M7.17157 4.17157C6.42143 4.92172 6 5.93913 6 7V9H18V7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H10C8.93913 3 7.92172 3.42143 7.17157 4.17157Z"})]}),Qc=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M6 7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H11M6 7V17C6 18.0609 6.42143 19.0783 7.17157 19.8284C7.92172 20.5786 8.93913 21 10 21H14C15.0609 21 16.0783 20.5786 16.8284 19.8284C17.5786 19.0783 18 18.0609 18 17V7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H11M6 7V10H11V3",fill:"var(--colors-grayA2)"}),i.jsx("path",{d:"M7.17157 4.17157C6.42143 4.92172 6 5.93913 6 7V10H11V3H10C8.93913 3 7.92172 3.42143 7.17157 4.17157Z"})]}),ei=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M18 7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H13M18 7V17C18 18.0609 17.5786 19.0783 16.8284 19.8284C16.0783 20.5786 15.0609 21 14 21H10C8.93913 21 7.92172 20.5786 7.17157 19.8284C6.42143 19.0783 6 18.0609 6 17V7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H13M18 7V10H13V3",fill:"var(--colors-grayA2)"}),i.jsx("path",{d:"M16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H13V10H18V7C18 5.93913 17.5786 4.92172 16.8284 4.17157Z"})]}),or={backspace:"⌫",delete:"Del",cmd:"⌘",alt:"⌥",option:"⌥",enter:"↩",ctrl:"⌃",shift:"⇧",tab:"⇥",capslock:"⇪"},ti=["OF","TF","MLD","MRD","MDD"],ni={OF:i.jsx(Zc,{width:"16px",height:"18px",stroke:"var(--colors-gray8)",strokeWidth:1.2,fill:"var(--colors-grayA2)",style:{marginLeft:"2px"}}),TF:i.jsx(qc,{width:"16px",height:"18px",stroke:"var(--colors-gray8)",strokeWidth:1.2,fill:"var(--colors-grayA2)",style:{marginLeft:"2px"}}),MLD:i.jsx(Qc,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2}),MRD:i.jsx(ei,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2}),MDD:i.jsx(Jc,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2})},ri=T("span",{display:"inline-block",marginLeft:"-1",height:"18px",width:"18px",variants:{half:{true:{marginLeft:"-0_5"}}}}),oi=T("kbd",{display:"inline-block",background:"$gray3",fontSize:"10px",minWidth:"$3",height:"$4",lineHeight:"14px",borderRadius:"$2",backgroundColor:"$grayA2",border:"1px solid $grayA4",padding:"0 $1",marginRight:"$1",color:"currentColor",userSelect:"none",variants:{size:{xs:{minWidth:"$3",height:"$3",fontSize:"10px",borderRadius:"$1",padding:"0 $0_5"},sm:{minWidth:"$4",height:"$4",fontSize:"10px"},md:{minWidth:"$5",height:"$5",fontSize:"$1",lineHeight:"$lineHeights$1",borderRadius:"$2",padding:"0 $1_5"}},uppercase:{true:{textTransform:"uppercase"}},lowercase:{true:{textTransform:"lowercase"}}},defaultVariants:{uppercase:!0}}),ar=T("div",{display:"inline-flex",alignItems:"center","& > kbd:last-child":{marginRight:0}}),sr=oi;function ai(e){const{shortcuts:t,uppercase:n=!0,size:r="sm"}=e;if(!t)return null;if(Array.isArray(t))return i.jsx(ar,{children:t.map((s,u)=>ti.indexOf(s)!==-1?i.jsx(ri,{children:ni[s]},u):i.jsx(sr,{uppercase:n,size:r,children:or[s]??s},u))});const o=t.split(/[,+]/).map(s=>or[s]??s);return i.jsx(ar,{children:o.map((s,u)=>i.jsx(sr,{uppercase:n,size:r,children:s},u))})}function D(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function cr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=cr(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():cr(e[o],null)}}}}function ce(...e){return a.useCallback(hn(...e),e)}function Ve(e,t=[]){let n=[];function r(s,u){const c=a.createContext(u),f=n.length;n=[...n,u];const p=l=>{var x;const{scope:m,children:v,...g}=l,h=((x=m==null?void 0:m[e])==null?void 0:x[f])||c,b=a.useMemo(()=>g,Object.values(g));return i.jsx(h.Provider,{value:b,children:v})};p.displayName=s+"Provider";function d(l,m){var h;const v=((h=m==null?void 0:m[e])==null?void 0:h[f])||c,g=a.useContext(v);if(g)return g;if(u!==void 0)return u;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[p,d]}const o=()=>{const s=n.map(u=>a.createContext(u));return function(c){const f=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,si(o,...t)]}function si(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const u=r.reduce((c,{useScope:f,scopeName:p})=>{const l=f(s)[`__scope${p}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var ci=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ie=ci.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...u}=r,c=s?dt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ii(e,t){e&&Nc.flushSync(()=>e.dispatchEvent(t))}function Zr(e){const t=e+"CollectionProvider",[n,r]=Ve(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=v=>{const{scope:g,children:h}=v,b=pe.useRef(null),x=pe.useRef(new Map).current;return i.jsx(o,{scope:g,itemMap:x,collectionRef:b,children:h})};u.displayName=t;const c=e+"CollectionSlot",f=pe.forwardRef((v,g)=>{const{scope:h,children:b}=v,x=s(c,h),M=ce(g,x.collectionRef);return i.jsx(dt,{ref:M,children:b})});f.displayName=c;const p=e+"CollectionItemSlot",d="data-radix-collection-item",l=pe.forwardRef((v,g)=>{const{scope:h,children:b,...x}=v,M=pe.useRef(null),w=ce(g,M),S=s(p,h);return pe.useEffect(()=>(S.itemMap.set(M,{ref:M,...x}),()=>void S.itemMap.delete(M))),i.jsx(dt,{[d]:"",ref:w,children:b})});l.displayName=p;function m(v){const g=s(e+"CollectionConsumer",v);return pe.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,R)=>x.indexOf(S.ref.current)-x.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:u,Slot:f,ItemSlot:l},m,r]}var ui="Arrow",qr=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return i.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});qr.displayName=ui;var li=qr,vn="Popper",[Jr,Qr]=Ve(vn),[di,eo]=Jr(vn),to=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return i.jsx(di,{scope:t,anchor:r,onAnchorChange:o,children:n})};to.displayName=vn;var no="PopperAnchor",ro=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=eo(no,n),u=a.useRef(null),c=ce(t,u);return a.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||u.current)}),r?null:i.jsx(ie.div,{...o,ref:c})});ro.displayName=no;var gn="PopperContent",[fi,pi]=Jr(gn),oo=a.forwardRef((e,t)=>{var G,ae,O,se,Qn,er;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:g,...h}=e,b=eo(gn,n),[x,M]=a.useState(null),w=ce(t,De=>M(De)),[S,R]=a.useState(null),I=$c(S),E=(I==null?void 0:I.width)??0,_=(I==null?void 0:I.height)??0,P=r+(s!=="center"?"-"+s:""),N=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(p)?p:[p],W=K.length>0,X={padding:N,boundary:K.filter(hi),altBoundary:W},{refs:Z,floatingStyles:ue,placement:z,isPositioned:le,middlewareData:L}=Oc({strategy:"fixed",placement:P,whileElementsMounted:(...De)=>Dc(...De,{animationFrame:v==="always"}),elements:{reference:b.anchor},middleware:[jc({mainAxis:o+_,alignmentAxis:u}),f&&Lc({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?kc():void 0,...X}),f&&Fc({...X}),Uc({...X,apply:({elements:De,rects:tr,availableWidth:_c,availableHeight:Ic})=>{const{width:Tc,height:Ac}=tr.reference,rt=De.floating.style;rt.setProperty("--radix-popper-available-width",`${_c}px`),rt.setProperty("--radix-popper-available-height",`${Ic}px`),rt.setProperty("--radix-popper-anchor-width",`${Tc}px`),rt.setProperty("--radix-popper-anchor-height",`${Ac}px`)}}),S&&Gc({element:S,padding:c}),vi({arrowWidth:E,arrowHeight:_}),m&&Kc({strategy:"referenceHidden",...X})]}),[C,A]=co(z),$=k(g);me(()=>{le&&($==null||$())},[le,$]);const j=(G=L.arrow)==null?void 0:G.x,q=(ae=L.arrow)==null?void 0:ae.y,J=((O=L.arrow)==null?void 0:O.centerOffset)!==0,[de,B]=a.useState();return me(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]),i.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...ue,transform:le?ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(se=L.transformOrigin)==null?void 0:se.x,(Qn=L.transformOrigin)==null?void 0:Qn.y].join(" "),...((er=L.hide)==null?void 0:er.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(fi,{scope:n,placedSide:C,onArrowChange:R,arrowX:j,arrowY:q,shouldHideArrow:J,children:i.jsx(ie.div,{"data-side":C,"data-align":A,...h,ref:w,style:{...h.style,animation:le?void 0:"none"}})})})});oo.displayName=gn;var ao="PopperArrow",mi={top:"bottom",right:"left",bottom:"top",left:"right"},so=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=pi(ao,r),u=mi[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(li,{...o,ref:n,style:{...o.style,display:"block"}})})});so.displayName=ao;function hi(e){return e!==null}var vi=e=>({name:"transformOrigin",options:e,fn(t){var b,x,M;const{placement:n,rects:r,middlewareData:o}=t,u=((b=o.arrow)==null?void 0:b.centerOffset)!==0,c=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[p,d]=co(n),l={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,v=(((M=o.arrow)==null?void 0:M.y)??0)+f/2;let g="",h="";return p==="bottom"?(g=u?l:`${m}px`,h=`${-f}px`):p==="top"?(g=u?l:`${m}px`,h=`${r.floating.height+f}px`):p==="right"?(g=`${-f}px`,h=u?l:`${v}px`):p==="left"&&(g=`${r.floating.width+f}px`,h=u?l:`${v}px`),{data:{x:g,y:h}}}});function co(e){const[t,n="center"]=e.split("-");return[t,n]}var io=to,gi=ro,Ci=oo,bi=so;function xi(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var He=e=>{const{present:t,children:n}=e,r=Mi(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=ce(r.ref,wi(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};He.displayName="Presence";function Mi(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),u=e?"mounted":"unmounted",[c,f]=xi(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const p=ot(r.current);s.current=c==="mounted"?p:"none"},[c]),me(()=>{const p=r.current,d=o.current;if(d!==e){const m=s.current,v=ot(p);e?f("MOUNT"):v==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),me(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,l=v=>{const h=ot(r.current).includes(v.animationName);if(v.target===t&&h&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=v=>{v.target===t&&(s.current=ot(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function ot(e){return(e==null?void 0:e.animationName)||"none"}function wi(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gt="rovingFocusGroup.onEntryFocus",Si={bubbles:!1,cancelable:!0},Et="RovingFocusGroup",[zt,uo,Ei]=Zr(Et),[yi,lo]=Ve(Et,[Ei]),[Ri,Pi]=yi(Et),fo=a.forwardRef((e,t)=>i.jsx(zt.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(zt.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(_i,{...e,ref:t})})}));fo.displayName=Et;var _i=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:u,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:d=!1,...l}=e,m=a.useRef(null),v=ce(t,m),g=Ne(s),[h=null,b]=$e({prop:u,defaultProp:c,onChange:f}),[x,M]=a.useState(!1),w=k(p),S=uo(n),R=a.useRef(!1),[I,E]=a.useState(0);return a.useEffect(()=>{const _=m.current;if(_)return _.addEventListener(Gt,w),()=>_.removeEventListener(Gt,w)},[w]),i.jsx(Ri,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:h,onItemFocus:a.useCallback(_=>b(_),[b]),onItemShiftTab:a.useCallback(()=>M(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:a.useCallback(()=>E(_=>_-1),[]),children:i.jsx(ie.div,{tabIndex:x||I===0?-1:0,"data-orientation":r,...l,ref:v,style:{outline:"none",...e.style},onMouseDown:D(e.onMouseDown,()=>{R.current=!0}),onFocus:D(e.onFocus,_=>{const P=!R.current;if(_.target===_.currentTarget&&P&&!x){const N=new CustomEvent(Gt,Si);if(_.currentTarget.dispatchEvent(N),!N.defaultPrevented){const K=S().filter(z=>z.focusable),W=K.find(z=>z.active),X=K.find(z=>z.id===h),ue=[W,X,...K].filter(Boolean).map(z=>z.ref.current);ho(ue,d)}}R.current=!1}),onBlur:D(e.onBlur,()=>M(!1))})})}),po="RovingFocusGroupItem",mo=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...u}=e,c=ee(),f=s||c,p=Pi(po,n),d=p.currentTabStopId===f,l=uo(n),{onFocusableItemAdd:m,onFocusableItemRemove:v}=p;return a.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),i.jsx(zt.ItemSlot,{scope:n,id:f,focusable:r,active:o,children:i.jsx(ie.span,{tabIndex:d?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:D(e.onMouseDown,g=>{r?p.onItemFocus(f):g.preventDefault()}),onFocus:D(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:D(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){p.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const h=Ai(g,p.orientation,p.dir);if(h!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=l().filter(M=>M.focusable).map(M=>M.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const M=x.indexOf(g.currentTarget);x=p.loop?Ni(x,M+1):x.slice(M+1)}setTimeout(()=>ho(x))}})})})});mo.displayName=po;var Ii={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ti(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ai(e,t,n){const r=Ti(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ii[r]}function ho(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ni(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $i=fo,Oi=mo,Zt=["Enter"," "],Di=["ArrowDown","PageUp","Home"],vo=["ArrowUp","PageDown","End"],ji=[...Di,...vo],Li={ltr:[...Zt,"ArrowRight"],rtl:[...Zt,"ArrowLeft"]},ki={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ye="Menu",[Fe,Fi,Ui]=Zr(Ye),[Se,go]=Ve(Ye,[Ui,Qr,lo]),Xe=Qr(),Co=lo(),[bo,Ce]=Se(Ye),[Gi,ze]=Se(Ye),xo=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=Xe(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(io,{...c,children:i.jsx(bo,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(Gi,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};xo.displayName=Ye;var Ki="MenuAnchor",Cn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xe(n);return i.jsx(gi,{...o,...r,ref:t})});Cn.displayName=Ki;var bn="MenuPortal",[Bi,Mo]=Se(bn,{forceMount:void 0}),wo=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Ce(bn,t);return i.jsx(Bi,{scope:t,forceMount:n,children:i.jsx(He,{present:n||s.open,children:i.jsx(Hc,{asChild:!0,container:o,children:r})})})};wo.displayName=bn;var te="MenuContent",[Wi,xn]=Se(te),So=a.forwardRef((e,t)=>{const n=Mo(te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ce(te,e.__scopeMenu),u=ze(te,e.__scopeMenu);return i.jsx(Fe.Provider,{scope:e.__scopeMenu,children:i.jsx(He,{present:r||s.open,children:i.jsx(Fe.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Vi,{...o,ref:t}):i.jsx(Hi,{...o,ref:t})})})})}),Vi=a.forwardRef((e,t)=>{const n=Ce(te,e.__scopeMenu),r=a.useRef(null),o=ce(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Mn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:D(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hi=a.forwardRef((e,t)=>{const n=Ce(te,e.__scopeMenu);return i.jsx(Mn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=Ce(te,n),x=ze(te,n),M=Xe(n),w=Co(n),S=Fi(n),[R,I]=a.useState(null),E=a.useRef(null),_=ce(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Vc:a.Fragment,z=g?{as:dt,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=ou(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),Dr();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&su(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Wi,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(Bc,{asChild:!0,trapped:o,onMountAutoFocus:D(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx($i,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:D(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Ci,{role:"menu","aria-orientation":"vertical","data-state":Uo(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:D(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!ji.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);vo.includes(C.key)&&B.reverse(),nu(B)}),onBlur:D(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:D(e.onPointerMove,Ue(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});So.displayName=te;var Yi="MenuGroup",wn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{role:"group",...r,ref:t})});wn.displayName=Yi;var Xi="MenuLabel",Eo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{...r,ref:t})});Eo.displayName=Xi;var ft="MenuItem",ir="menu.itemSelect",yt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=ze(ft,e.__scopeMenu),c=xn(ft,e.__scopeMenu),f=ce(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(ir,{bubbles:!0,cancelable:!0});l.addEventListener(ir,v=>r==null?void 0:r(v),{once:!0}),ii(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(yo,{...o,ref:f,disabled:n,onClick:D(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:D(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:D(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||Zt.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});yt.displayName=ft;var yo=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=xn(ft,n),c=Co(n),f=a.useRef(null),p=ce(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Fe.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(Oi,{asChild:!0,...c,focusable:!r,children:i.jsx(ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:D(e.onPointerMove,Ue(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:D(e.onPointerLeave,Ue(g=>u.onItemLeave(g))),onFocus:D(e.onFocus,()=>l(!0)),onBlur:D(e.onBlur,()=>l(!1))})})})}),zi="MenuCheckboxItem",Ro=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(Ao,{scope:e.__scopeMenu,checked:n,children:i.jsx(yt,{role:"menuitemcheckbox","aria-checked":pt(n)?"mixed":n,...o,ref:t,"data-state":yn(n),onSelect:D(o.onSelect,()=>r==null?void 0:r(pt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ro.displayName=zi;var Po="MenuRadioGroup",[Zi,qi]=Se(Po,{value:void 0,onValueChange:()=>{}}),_o=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(Zi,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(wn,{...o,ref:t})})});_o.displayName=Po;var Io="MenuRadioItem",To=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=qi(Io,e.__scopeMenu),s=n===o.value;return i.jsx(Ao,{scope:e.__scopeMenu,checked:s,children:i.jsx(yt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":yn(s),onSelect:D(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});To.displayName=Io;var Sn="MenuItemIndicator",[Ao,Ji]=Se(Sn,{checked:!1}),No=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Ji(Sn,n);return i.jsx(He,{present:r||pt(s.checked)||s.checked===!0,children:i.jsx(ie.span,{...o,ref:t,"data-state":yn(s.checked)})})});No.displayName=Sn;var Qi="MenuSeparator",$o=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$o.displayName=Qi;var eu="MenuArrow",Oo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xe(n);return i.jsx(bi,{...o,...r,ref:t})});Oo.displayName=eu;var En="MenuSub",[tu,Do]=Se(En),jo=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Ce(En,t),u=Xe(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(io,{...u,children:i.jsx(bo,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(tu,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};jo.displayName=En;var je="MenuSubTrigger",Lo=a.forwardRef((e,t)=>{const n=Ce(je,e.__scopeMenu),r=ze(je,e.__scopeMenu),o=Do(je,e.__scopeMenu),s=xn(je,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(Cn,{asChild:!0,...p,children:i.jsx(yo,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Uo(n.open),...e,ref:hn(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:D(e.onPointerMove,Ue(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:D(e.onPointerLeave,Ue(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:D(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Li[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Lo.displayName=je;var ko="MenuSubContent",Fo=a.forwardRef((e,t)=>{const n=Mo(te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ce(te,e.__scopeMenu),u=ze(te,e.__scopeMenu),c=Do(ko,e.__scopeMenu),f=a.useRef(null),p=ce(t,f);return i.jsx(Fe.Provider,{scope:e.__scopeMenu,children:i.jsx(He,{present:r||s.open,children:i.jsx(Fe.Slot,{scope:e.__scopeMenu,children:i.jsx(Mn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:D(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:D(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:D(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=ki[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Fo.displayName=ko;function Uo(e){return e?"open":"closed"}function pt(e){return e==="indeterminate"}function yn(e){return pt(e)?"indeterminate":e?"checked":"unchecked"}function nu(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ru(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ou(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=ru(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function au(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function su(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return au(n,t)}function Ue(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cu=xo,iu=Cn,uu=wo,lu=So,du=wn,fu=Eo,pu=yt,mu=Ro,hu=_o,vu=To,gu=No,Cu=$o,bu=Oo,xu=jo,Mu=Lo,wu=Fo,Rn="DropdownMenu",[Su,ym]=Ve(Rn,[go]),V=go(),[Eu,Go]=Su(Rn),Ko=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:u,modal:c=!0}=e,f=V(t),p=a.useRef(null),[d=!1,l]=$e({prop:o,defaultProp:s,onChange:u});return i.jsx(Eu,{scope:t,triggerId:ee(),triggerRef:p,contentId:ee(),open:d,onOpenChange:l,onOpenToggle:a.useCallback(()=>l(m=>!m),[l]),modal:c,children:i.jsx(cu,{...f,open:d,onOpenChange:l,dir:r,modal:c,children:n})})};Ko.displayName=Rn;var Bo="DropdownMenuTrigger",Wo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Go(Bo,n),u=V(n);return i.jsx(iu,{asChild:!0,...u,children:i.jsx(ie.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:hn(t,s.triggerRef),onPointerDown:D(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:D(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Wo.displayName=Bo;var yu="DropdownMenuPortal",Vo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=V(t);return i.jsx(uu,{...r,...n})};Vo.displayName=yu;var Ho="DropdownMenuContent",Yo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Go(Ho,n),s=V(n),u=a.useRef(!1);return i.jsx(lu,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:D(e.onCloseAutoFocus,c=>{var f;u.current||(f=o.triggerRef.current)==null||f.focus(),u.current=!1,c.preventDefault()}),onInteractOutside:D(e.onInteractOutside,c=>{const f=c.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,d=f.button===2||p;(!o.modal||d)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yo.displayName=Ho;var Ru="DropdownMenuGroup",Xo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(du,{...o,...r,ref:t})});Xo.displayName=Ru;var Pu="DropdownMenuLabel",zo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(fu,{...o,...r,ref:t})});zo.displayName=Pu;var _u="DropdownMenuItem",Zo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(pu,{...o,...r,ref:t})});Zo.displayName=_u;var Iu="DropdownMenuCheckboxItem",qo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(mu,{...o,...r,ref:t})});qo.displayName=Iu;var Tu="DropdownMenuRadioGroup",Jo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(hu,{...o,...r,ref:t})});Jo.displayName=Tu;var Au="DropdownMenuRadioItem",Qo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(vu,{...o,...r,ref:t})});Qo.displayName=Au;var Nu="DropdownMenuItemIndicator",ea=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(gu,{...o,...r,ref:t})});ea.displayName=Nu;var $u="DropdownMenuSeparator",ta=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(Cu,{...o,...r,ref:t})});ta.displayName=$u;var Ou="DropdownMenuArrow",Du=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(bu,{...o,...r,ref:t})});Du.displayName=Ou;var ju=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,u=V(t),[c=!1,f]=$e({prop:r,defaultProp:s,onChange:o});return i.jsx(xu,{...u,open:c,onOpenChange:f,children:n})},Lu="DropdownMenuSubTrigger",na=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(Mu,{...o,...r,ref:t})});na.displayName=Lu;var ku="DropdownMenuSubContent",ra=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(wu,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ra.displayName=ku;var oa=Ko,Fu=Wo,aa=Vo,Uu=Yo,Gu=Xo,Ku=zo,Bu=Zo,Wu=qo,Vu=Jo,Hu=Qo,Yu=ea,Xu=ta,zu=ju,Zu=na,qu=ra,Ju="DismissableLayer",qt="dismissableLayer.update",Qu="dismissableLayer.pointerDownOutside",el="dismissableLayer.focusOutside",ur,sa=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ca=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:c,...f}=e,p=a.useContext(sa),[d,l]=a.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=U(t,E=>l(E)),h=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(b),M=d?h.indexOf(d):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,S=M>=x,R=rl(E=>{const _=E.target,P=[...p.branches].some(N=>N.contains(_));!S||P||(o==null||o(E),u==null||u(E),E.defaultPrevented||c==null||c())},m),I=ol(E=>{const _=E.target;[...p.branches].some(N=>N.contains(_))||(s==null||s(E),u==null||u(E),E.defaultPrevented||c==null||c())},m);return jr(E=>{M===p.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),a.useEffect(()=>{if(d)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(ur=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),lr(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ur)}},[d,m,n,p]),a.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),lr())},[d,p]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(qt,E),()=>document.removeEventListener(qt,E)},[]),i.jsx(F.div,{...f,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:y(e.onFocusCapture,I.onFocusCapture),onBlurCapture:y(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:y(e.onPointerDownCapture,R.onPointerDownCapture)})});ca.displayName=Ju;var tl="DismissableLayerBranch",nl=a.forwardRef((e,t)=>{const n=a.useContext(sa),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(F.div,{...e,ref:o})});nl.displayName=tl;function rl(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){ia(Qu,n,p,{discrete:!0})};const p={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ol(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&ia(el,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lr(){const e=new CustomEvent(qt);document.dispatchEvent(e)}function ia(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,s):o.dispatchEvent(s)}var Kt=0;function al(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??dr()),document.body.insertAdjacentElement("beforeend",e[1]??dr()),Kt++,()=>{Kt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kt--}},[])}function dr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Bt="focusScope.autoFocusOnMount",Wt="focusScope.autoFocusOnUnmount",fr={bubbles:!1,cancelable:!0},sl="FocusScope",ua=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...u}=e,[c,f]=a.useState(null),p=k(o),d=k(s),l=a.useRef(null),m=U(t,h=>f(h)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let h=function(w){if(v.paused||!c)return;const S=w.target;c.contains(S)?l.current=S:he(l.current,{select:!0})},b=function(w){if(v.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||he(l.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&he(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const M=new MutationObserver(x);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),M.disconnect()}}},[r,c,v.paused]),a.useEffect(()=>{if(c){mr.add(v);const h=document.activeElement;if(!c.contains(h)){const x=new CustomEvent(Bt,fr);c.addEventListener(Bt,p),c.dispatchEvent(x),x.defaultPrevented||(cl(fl(la(c)),{select:!0}),document.activeElement===h&&he(c))}return()=>{c.removeEventListener(Bt,p),setTimeout(()=>{const x=new CustomEvent(Wt,fr);c.addEventListener(Wt,d),c.dispatchEvent(x),x.defaultPrevented||he(h??document.body,{select:!0}),c.removeEventListener(Wt,d),mr.remove(v)},0)}}},[c,p,d,v]);const g=a.useCallback(h=>{if(!n&&!r||v.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(b&&x){const M=h.currentTarget,[w,S]=il(M);w&&S?!h.shiftKey&&x===S?(h.preventDefault(),n&&he(w,{select:!0})):h.shiftKey&&x===w&&(h.preventDefault(),n&&he(S,{select:!0})):x===M&&h.preventDefault()}},[n,r,v.paused]);return i.jsx(F.div,{tabIndex:-1,...u,ref:m,onKeyDown:g})});ua.displayName=sl;function cl(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(he(r,{select:t}),document.activeElement!==n)return}function il(e){const t=la(e),n=pr(t,e),r=pr(t.reverse(),e);return[n,r]}function la(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pr(e,t){for(const n of e)if(!ul(n,{upTo:t}))return n}function ul(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ll(e){return e instanceof HTMLInputElement&&"select"in e}function he(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ll(e)&&t&&e.select()}}var mr=dl();function dl(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hr(e,t),e.unshift(t)},remove(t){var n;e=hr(e,t),(n=e[0])==null||n.resume()}}}function hr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fl(e){return e.filter(t=>t.tagName!=="A")}var pl="Portal",da=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,s]=a.useState(!1);me(()=>s(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?Lr.createPortal(i.jsx(F.div,{...r,ref:t}),u):null});da.displayName=pl;var fa=a.forwardRef((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),s=o.find(hl);if(s){const u=s.props.children,c=o.map(f=>f===s?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return i.jsx(Jt,{...r,ref:t,children:a.isValidElement(u)?a.cloneElement(u,void 0,c):null})}return i.jsx(Jt,{...r,ref:t,children:n})});fa.displayName="Slot";var Jt=a.forwardRef((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const o=gl(n);return a.cloneElement(n,{...vl(r,n.props),ref:t?Mt(t,o):o})}return a.Children.count(n)>1?a.Children.only(null):null});Jt.displayName="SlotClone";var ml=({children:e})=>i.jsx(i.Fragment,{children:e});function hl(e){return a.isValidElement(e)&&e.type===ml}function vl(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function gl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pa=kr(),Vt=function(){},Rt=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Vt,onWheelCapture:Vt,onTouchMoveCapture:Vt}),o=r[0],s=r[1],u=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,d=e.enabled,l=e.shards,m=e.sideCar,v=e.noIsolation,g=e.inert,h=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,M=e.gapMode,w=Fr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,R=Ur([n,t]),I=Q(Q({},w),o);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:pa,removeScrollBar:p,shards:l,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:M}),u?a.cloneElement(a.Children.only(c),Q(Q({},I),{ref:R})):a.createElement(x,Q({},I,{className:f,ref:R}),c))});Rt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rt.classNames={fullWidth:Gr,zeroRight:Kr};var Qt=!1;if(typeof window<"u")try{var at=Object.defineProperty({},"passive",{get:function(){return Qt=!0,!0}});window.addEventListener("test",at,at),window.removeEventListener("test",at,at)}catch{Qt=!1}var Pe=Qt?{passive:!1}:!1,Cl=function(e){return e.tagName==="TEXTAREA"},ma=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cl(e)&&n[t]==="visible")},bl=function(e){return ma(e,"overflowY")},xl=function(e){return ma(e,"overflowX")},vr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ha(e,r);if(o){var s=va(e,r),u=s[1],c=s[2];if(u>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ml=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wl=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ha=function(e,t){return e==="v"?bl(t):xl(t)},va=function(e,t){return e==="v"?Ml(t):wl(t)},Sl=function(e,t){return e==="h"&&t==="rtl"?-1:1},El=function(e,t,n,r,o){var s=Sl(e,window.getComputedStyle(t).direction),u=s*r,c=n.target,f=t.contains(c),p=!1,d=u>0,l=0,m=0;do{var v=va(e,c),g=v[0],h=v[1],b=v[2],x=h-b-s*g;(g||x)&&ha(e,c)&&(l+=x,m+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(d&&(o&&Math.abs(l)<1||!o&&u>l)||!d&&(o&&Math.abs(m)<1||!o&&-u>m))&&(p=!0),p},st=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gr=function(e){return[e.deltaX,e.deltaY]},Cr=function(e){return e&&"current"in e?e.current:e},yl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rl=function(e){return`
|
|
12
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
13
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
14
|
+
`)},Pl=0,_e=[];function _l(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(Pl++)[0],s=a.useState(Br)[0],u=a.useRef(e);a.useEffect(function(){u.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Wr([e.lockRef.current],(e.shards||[]).map(Cr),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(h,b){if("touches"in h&&h.touches.length===2)return!u.current.allowPinchZoom;var x=st(h),M=n.current,w="deltaX"in h?h.deltaX:M[0]-x[0],S="deltaY"in h?h.deltaY:M[1]-x[1],R,I=h.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&E==="h"&&I.type==="range")return!1;var _=vr(E,I);if(!_)return!0;if(_?R=E:(R=E==="v"?"h":"v",_=vr(E,I)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||S)&&(r.current=R),!R)return!0;var P=r.current||R;return El(P,b,h,P==="h"?w:S,!0)},[]),f=a.useCallback(function(h){var b=h;if(!(!_e.length||_e[_e.length-1]!==s)){var x="deltaY"in b?gr(b):st(b),M=t.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&yl(R.delta,x)})[0];if(M&&M.should){b.cancelable&&b.preventDefault();return}if(!M){var w=(u.current.shards||[]).map(Cr).filter(Boolean).filter(function(R){return R.contains(b.target)}),S=w.length>0?c(b,w[0]):!u.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),p=a.useCallback(function(h,b,x,M){var w={name:h,delta:b,target:x,should:M,shadowParent:Il(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=a.useCallback(function(h){n.current=st(h),r.current=void 0},[]),l=a.useCallback(function(h){p(h.type,gr(h),h.target,c(h,e.lockRef.current))},[]),m=a.useCallback(function(h){p(h.type,st(h),h.target,c(h,e.lockRef.current))},[]);a.useEffect(function(){return _e.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Pe),document.addEventListener("touchmove",f,Pe),document.addEventListener("touchstart",d,Pe),function(){_e=_e.filter(function(h){return h!==s}),document.removeEventListener("wheel",f,Pe),document.removeEventListener("touchmove",f,Pe),document.removeEventListener("touchstart",d,Pe)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Rl(o)}):null,v?a.createElement(Vr,{gapMode:e.gapMode}):null)}function Il(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tl=Hr(pa,_l);var ga=a.forwardRef(function(e,t){return a.createElement(Rt,Q({},e,{ref:t,sideCar:Tl}))});ga.classNames=Rt.classNames;const Al=ga;var en=["Enter"," "],Nl=["ArrowDown","PageUp","Home"],Ca=["ArrowUp","PageDown","End"],$l=[...Nl,...Ca],Ol={ltr:[...en,"ArrowRight"],rtl:[...en,"ArrowLeft"]},Dl={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ze="Menu",[Ge,jl,Ll]=dn(Ze),[Ee,ba]=fn(Ze,[Ll,wt,Oe]),qe=wt(),xa=Oe(),[Ma,be]=Ee(Ze),[kl,Je]=Ee(Ze),wa=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=qe(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(St,{...c,children:i.jsx(Ma,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(kl,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};wa.displayName=Ze;var Fl="MenuAnchor",Pn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qe(n);return i.jsx(Yr,{...o,...r,ref:t})});Pn.displayName=Fl;var _n="MenuPortal",[Ul,Sa]=Ee(_n,{forceMount:void 0}),Ea=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=be(_n,t);return i.jsx(Ul,{scope:t,forceMount:n,children:i.jsx(ge,{present:n||s.open,children:i.jsx(da,{asChild:!0,container:o,children:r})})})};Ea.displayName=_n;var ne="MenuContent",[Gl,In]=Ee(ne),ya=a.forwardRef((e,t)=>{const n=Sa(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=be(ne,e.__scopeMenu),u=Je(ne,e.__scopeMenu);return i.jsx(Ge.Provider,{scope:e.__scopeMenu,children:i.jsx(ge,{present:r||s.open,children:i.jsx(Ge.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Kl,{...o,ref:t}):i.jsx(Bl,{...o,ref:t})})})})}),Kl=a.forwardRef((e,t)=>{const n=be(ne,e.__scopeMenu),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Tn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bl=a.forwardRef((e,t)=>{const n=be(ne,e.__scopeMenu);return i.jsx(Tn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Tn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=be(ne,n),x=Je(ne,n),M=qe(n),w=xa(n),S=jl(n),[R,I]=a.useState(null),E=a.useRef(null),_=U(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Al:a.Fragment,z=g?{as:fa,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=td(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),al();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&rd(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Gl,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(ua,{asChild:!0,trapped:o,onMountAutoFocus:y(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(ca,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx(pn,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:y(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Xr,{role:"menu","aria-orientation":"vertical","data-state":Ka(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:y(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!$l.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);Ca.includes(C.key)&&B.reverse(),Ql(B)}),onBlur:y(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:y(e.onPointerMove,Ke(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});ya.displayName=ne;var Wl="MenuGroup",An=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"group",...r,ref:t})});An.displayName=Wl;var Vl="MenuLabel",Ra=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{...r,ref:t})});Ra.displayName=Vl;var mt="MenuItem",br="menu.itemSelect",Pt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=Je(mt,e.__scopeMenu),c=In(mt,e.__scopeMenu),f=U(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(br,{bubbles:!0,cancelable:!0});l.addEventListener(br,v=>r==null?void 0:r(v),{once:!0}),xt(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(Pa,{...o,ref:f,disabled:n,onClick:y(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:y(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:y(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||en.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});Pt.displayName=mt;var Pa=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=In(mt,n),c=xa(n),f=a.useRef(null),p=U(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Ge.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(mn,{asChild:!0,...c,focusable:!r,children:i.jsx(F.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:y(e.onPointerMove,Ke(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,Ke(g=>u.onItemLeave(g))),onFocus:y(e.onFocus,()=>l(!0)),onBlur:y(e.onBlur,()=>l(!1))})})})}),Hl="MenuCheckboxItem",_a=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx($a,{scope:e.__scopeMenu,checked:n,children:i.jsx(Pt,{role:"menuitemcheckbox","aria-checked":ht(n)?"mixed":n,...o,ref:t,"data-state":On(n),onSelect:y(o.onSelect,()=>r==null?void 0:r(ht(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_a.displayName=Hl;var Ia="MenuRadioGroup",[Yl,Xl]=Ee(Ia,{value:void 0,onValueChange:()=>{}}),Ta=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(Yl,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(An,{...o,ref:t})})});Ta.displayName=Ia;var Aa="MenuRadioItem",Na=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Xl(Aa,e.__scopeMenu),s=n===o.value;return i.jsx($a,{scope:e.__scopeMenu,checked:s,children:i.jsx(Pt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":On(s),onSelect:y(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});Na.displayName=Aa;var Nn="MenuItemIndicator",[$a,zl]=Ee(Nn,{checked:!1}),Oa=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=zl(Nn,n);return i.jsx(ge,{present:r||ht(s.checked)||s.checked===!0,children:i.jsx(F.span,{...o,ref:t,"data-state":On(s.checked)})})});Oa.displayName=Nn;var Zl="MenuSeparator",Da=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Da.displayName=Zl;var ql="MenuArrow",ja=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qe(n);return i.jsx(zr,{...o,...r,ref:t})});ja.displayName=ql;var $n="MenuSub",[Jl,La]=Ee($n),ka=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=be($n,t),u=qe(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(St,{...u,children:i.jsx(Ma,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(Jl,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};ka.displayName=$n;var Le="MenuSubTrigger",Fa=a.forwardRef((e,t)=>{const n=be(Le,e.__scopeMenu),r=Je(Le,e.__scopeMenu),o=La(Le,e.__scopeMenu),s=In(Le,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(Pn,{asChild:!0,...p,children:i.jsx(Pa,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ka(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,Ke(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:y(e.onPointerLeave,Ke(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:y(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Ol[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Fa.displayName=Le;var Ua="MenuSubContent",Ga=a.forwardRef((e,t)=>{const n=Sa(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=be(ne,e.__scopeMenu),u=Je(ne,e.__scopeMenu),c=La(Ua,e.__scopeMenu),f=a.useRef(null),p=U(t,f);return i.jsx(Ge.Provider,{scope:e.__scopeMenu,children:i.jsx(ge,{present:r||s.open,children:i.jsx(Ge.Slot,{scope:e.__scopeMenu,children:i.jsx(Tn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:y(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:y(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=Dl[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Ga.displayName=Ua;function Ka(e){return e?"open":"closed"}function ht(e){return e==="indeterminate"}function On(e){return ht(e)?"indeterminate":e?"checked":"unchecked"}function Ql(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ed(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function td(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=ed(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function nd(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function rd(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nd(n,t)}function Ke(e){return t=>t.pointerType==="mouse"?e(t):void 0}var od=wa,ad=Pn,sd=Ea,cd=ya,id=An,ud=Ra,ld=Pt,dd=_a,fd=Ta,pd=Na,md=Oa,hd=Da,vd=ja,gd=ka,Cd=Fa,bd=Ga,Dn="ContextMenu",[xd,Rm]=fn(Dn,[ba]),H=ba(),[Md,Ba]=xd(Dn),Wa=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:s=!0}=e,[u,c]=a.useState(!1),f=H(t),p=k(r),d=a.useCallback(l=>{c(l),p(l)},[p]);return i.jsx(Md,{scope:t,open:u,onOpenChange:d,modal:s,children:i.jsx(od,{...f,dir:o,open:u,onOpenChange:d,modal:s,children:n})})};Wa.displayName=Dn;var Va="ContextMenuTrigger",Ha=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,s=Ba(Va,n),u=H(n),c=a.useRef({x:0,y:0}),f=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),p=a.useRef(0),d=a.useCallback(()=>window.clearTimeout(p.current),[]),l=m=>{c.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return a.useEffect(()=>d,[d]),a.useEffect(()=>void(r&&d()),[r,d]),i.jsxs(i.Fragment,{children:[i.jsx(ad,{...u,virtualRef:f}),i.jsx(F.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:y(e.onContextMenu,m=>{d(),l(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:y(e.onPointerDown,ct(m=>{d(),p.current=window.setTimeout(()=>l(m),700)})),onPointerMove:r?e.onPointerMove:y(e.onPointerMove,ct(d)),onPointerCancel:r?e.onPointerCancel:y(e.onPointerCancel,ct(d)),onPointerUp:r?e.onPointerUp:y(e.onPointerUp,ct(d))})]})});Ha.displayName=Va;var wd="ContextMenuPortal",Ya=e=>{const{__scopeContextMenu:t,...n}=e,r=H(t);return i.jsx(sd,{...r,...n})};Ya.displayName=wd;var Xa="ContextMenuContent",za=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Ba(Xa,n),s=H(n),u=a.useRef(!1);return i.jsx(cd,{...s,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var f;(f=e.onCloseAutoFocus)==null||f.call(e,c),!c.defaultPrevented&&u.current&&c.preventDefault(),u.current=!1},onInteractOutside:c=>{var f;(f=e.onInteractOutside)==null||f.call(e,c),!c.defaultPrevented&&!o.modal&&(u.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});za.displayName=Xa;var Sd="ContextMenuGroup",Za=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(id,{...o,...r,ref:t})});Za.displayName=Sd;var Ed="ContextMenuLabel",qa=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(ud,{...o,...r,ref:t})});qa.displayName=Ed;var yd="ContextMenuItem",Ja=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(ld,{...o,...r,ref:t})});Ja.displayName=yd;var Rd="ContextMenuCheckboxItem",Qa=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(dd,{...o,...r,ref:t})});Qa.displayName=Rd;var Pd="ContextMenuRadioGroup",es=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(fd,{...o,...r,ref:t})});es.displayName=Pd;var _d="ContextMenuRadioItem",ts=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(pd,{...o,...r,ref:t})});ts.displayName=_d;var Id="ContextMenuItemIndicator",ns=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(md,{...o,...r,ref:t})});ns.displayName=Id;var Td="ContextMenuSeparator",rs=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(hd,{...o,...r,ref:t})});rs.displayName=Td;var Ad="ContextMenuArrow",Nd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(vd,{...o,...r,ref:t})});Nd.displayName=Ad;var $d="ContextMenuSub",os=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:s}=e,u=H(t),[c,f]=$e({prop:o,defaultProp:s,onChange:r});return i.jsx(gd,{...u,open:c,onOpenChange:f,children:n})};os.displayName=$d;var Od="ContextMenuSubTrigger",as=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(Cd,{...o,...r,ref:t})});as.displayName=Od;var Dd="ContextMenuSubContent",ss=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(bd,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ss.displayName=Dd;function ct(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var cs=Wa,jd=Ha,is=Ya,Ld=za,kd=Za,Fd=qa,Ud=Ja,Gd=Qa,Kd=es,Bd=ts,Wd=ns,Vd=rs,Hd=os,Yd=as,Xd=ss;function us(e,t=[]){let n=[];function r(s,u){const c=a.createContext(u),f=n.length;n=[...n,u];const p=l=>{var x;const{scope:m,children:v,...g}=l,h=((x=m==null?void 0:m[e])==null?void 0:x[f])||c,b=a.useMemo(()=>g,Object.values(g));return i.jsx(h.Provider,{value:b,children:v})};p.displayName=s+"Provider";function d(l,m){var h;const v=((h=m==null?void 0:m[e])==null?void 0:h[f])||c,g=a.useContext(v);if(g)return g;if(u!==void 0)return u;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[p,d]}const o=()=>{const s=n.map(u=>a.createContext(u));return function(c){const f=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,zd(o,...t)]}function zd(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const u=r.reduce((c,{useScope:f,scopeName:p})=>{const l=f(s)[`__scope${p}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Zd="DismissableLayer",tn="dismissableLayer.update",qd="dismissableLayer.pointerDownOutside",Jd="dismissableLayer.focusOutside",xr,ls=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ds=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:c,...f}=e,p=a.useContext(ls),[d,l]=a.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=U(t,E=>l(E)),h=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(b),M=d?h.indexOf(d):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,S=M>=x,R=tf(E=>{const _=E.target,P=[...p.branches].some(N=>N.contains(_));!S||P||(o==null||o(E),u==null||u(E),E.defaultPrevented||c==null||c())},m),I=nf(E=>{const _=E.target;[...p.branches].some(N=>N.contains(_))||(s==null||s(E),u==null||u(E),E.defaultPrevented||c==null||c())},m);return jr(E=>{M===p.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),a.useEffect(()=>{if(d)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(xr=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Mr(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=xr)}},[d,m,n,p]),a.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Mr())},[d,p]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(tn,E),()=>document.removeEventListener(tn,E)},[]),i.jsx(F.div,{...f,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:y(e.onFocusCapture,I.onFocusCapture),onBlurCapture:y(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:y(e.onPointerDownCapture,R.onPointerDownCapture)})});ds.displayName=Zd;var Qd="DismissableLayerBranch",ef=a.forwardRef((e,t)=>{const n=a.useContext(ls),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(F.div,{...e,ref:o})});ef.displayName=Qd;function tf(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){fs(qd,n,p,{discrete:!0})};const p={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nf(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&fs(Jd,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mr(){const e=new CustomEvent(tn);document.dispatchEvent(e)}function fs(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,s):o.dispatchEvent(s)}var Ht="focusScope.autoFocusOnMount",Yt="focusScope.autoFocusOnUnmount",wr={bubbles:!1,cancelable:!0},rf="FocusScope",ps=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...u}=e,[c,f]=a.useState(null),p=k(o),d=k(s),l=a.useRef(null),m=U(t,h=>f(h)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let h=function(w){if(v.paused||!c)return;const S=w.target;c.contains(S)?l.current=S:ve(l.current,{select:!0})},b=function(w){if(v.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||ve(l.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&ve(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const M=new MutationObserver(x);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),M.disconnect()}}},[r,c,v.paused]),a.useEffect(()=>{if(c){Er.add(v);const h=document.activeElement;if(!c.contains(h)){const x=new CustomEvent(Ht,wr);c.addEventListener(Ht,p),c.dispatchEvent(x),x.defaultPrevented||(of(lf(ms(c)),{select:!0}),document.activeElement===h&&ve(c))}return()=>{c.removeEventListener(Ht,p),setTimeout(()=>{const x=new CustomEvent(Yt,wr);c.addEventListener(Yt,d),c.dispatchEvent(x),x.defaultPrevented||ve(h??document.body,{select:!0}),c.removeEventListener(Yt,d),Er.remove(v)},0)}}},[c,p,d,v]);const g=a.useCallback(h=>{if(!n&&!r||v.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(b&&x){const M=h.currentTarget,[w,S]=af(M);w&&S?!h.shiftKey&&x===S?(h.preventDefault(),n&&ve(w,{select:!0})):h.shiftKey&&x===w&&(h.preventDefault(),n&&ve(S,{select:!0})):x===M&&h.preventDefault()}},[n,r,v.paused]);return i.jsx(F.div,{tabIndex:-1,...u,ref:m,onKeyDown:g})});ps.displayName=rf;function of(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ve(r,{select:t}),document.activeElement!==n)return}function af(e){const t=ms(e),n=Sr(t,e),r=Sr(t.reverse(),e);return[n,r]}function ms(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sr(e,t){for(const n of e)if(!sf(n,{upTo:t}))return n}function sf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cf(e){return e instanceof HTMLInputElement&&"select"in e}function ve(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cf(e)&&t&&e.select()}}var Er=uf();function uf(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yr(e,t),e.unshift(t)},remove(t){var n;e=yr(e,t),(n=e[0])==null||n.resume()}}}function yr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lf(e){return e.filter(t=>t.tagName!=="A")}var df="Portal",hs=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,s]=a.useState(!1);me(()=>s(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?Lr.createPortal(i.jsx(F.div,{...r,ref:t}),u):null});hs.displayName=df;function ff(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Qe=e=>{const{present:t,children:n}=e,r=pf(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=U(r.ref,mf(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};Qe.displayName="Presence";function pf(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),u=e?"mounted":"unmounted",[c,f]=ff(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const p=it(r.current);s.current=c==="mounted"?p:"none"},[c]),me(()=>{const p=r.current,d=o.current;if(d!==e){const m=s.current,v=it(p);e?f("MOUNT"):v==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),me(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,l=v=>{const h=it(r.current).includes(v.animationName);if(v.target===t&&h&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=v=>{v.target===t&&(s.current=it(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function it(e){return(e==null?void 0:e.animationName)||"none"}function mf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vs=a.forwardRef((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),s=o.find(vf);if(s){const u=s.props.children,c=o.map(f=>f===s?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return i.jsx(nn,{...r,ref:t,children:a.isValidElement(u)?a.cloneElement(u,void 0,c):null})}return i.jsx(nn,{...r,ref:t,children:n})});vs.displayName="Slot";var nn=a.forwardRef((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const o=Cf(n);return a.cloneElement(n,{...gf(r,n.props),ref:t?Mt(t,o):o})}return a.Children.count(n)>1?a.Children.only(null):null});nn.displayName="SlotClone";var hf=({children:e})=>i.jsx(i.Fragment,{children:e});function vf(e){return a.isValidElement(e)&&e.type===hf}function gf(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gs=kr(),Xt=function(){},_t=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Xt,onWheelCapture:Xt,onTouchMoveCapture:Xt}),o=r[0],s=r[1],u=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,d=e.enabled,l=e.shards,m=e.sideCar,v=e.noIsolation,g=e.inert,h=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,M=e.gapMode,w=Fr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,R=Ur([n,t]),I=Q(Q({},w),o);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:gs,removeScrollBar:p,shards:l,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:M}),u?a.cloneElement(a.Children.only(c),Q(Q({},I),{ref:R})):a.createElement(x,Q({},I,{className:f,ref:R}),c))});_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_t.classNames={fullWidth:Gr,zeroRight:Kr};var rn=!1;if(typeof window<"u")try{var ut=Object.defineProperty({},"passive",{get:function(){return rn=!0,!0}});window.addEventListener("test",ut,ut),window.removeEventListener("test",ut,ut)}catch{rn=!1}var Ie=rn?{passive:!1}:!1,bf=function(e){return e.tagName==="TEXTAREA"},Cs=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bf(e)&&n[t]==="visible")},xf=function(e){return Cs(e,"overflowY")},Mf=function(e){return Cs(e,"overflowX")},Rr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bs(e,r);if(o){var s=xs(e,r),u=s[1],c=s[2];if(u>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wf=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Sf=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bs=function(e,t){return e==="v"?xf(t):Mf(t)},xs=function(e,t){return e==="v"?wf(t):Sf(t)},Ef=function(e,t){return e==="h"&&t==="rtl"?-1:1},yf=function(e,t,n,r,o){var s=Ef(e,window.getComputedStyle(t).direction),u=s*r,c=n.target,f=t.contains(c),p=!1,d=u>0,l=0,m=0;do{var v=xs(e,c),g=v[0],h=v[1],b=v[2],x=h-b-s*g;(g||x)&&bs(e,c)&&(l+=x,m+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(d&&(o&&Math.abs(l)<1||!o&&u>l)||!d&&(o&&Math.abs(m)<1||!o&&-u>m))&&(p=!0),p},lt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pr=function(e){return[e.deltaX,e.deltaY]},_r=function(e){return e&&"current"in e?e.current:e},Rf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pf=function(e){return`
|
|
15
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
16
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
17
|
+
`)},_f=0,Te=[];function If(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(_f++)[0],s=a.useState(Br)[0],u=a.useRef(e);a.useEffect(function(){u.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Wr([e.lockRef.current],(e.shards||[]).map(_r),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!u.current.allowPinchZoom;var x=lt(h),M=n.current,w="deltaX"in h?h.deltaX:M[0]-x[0],S="deltaY"in h?h.deltaY:M[1]-x[1],R,I=h.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&E==="h"&&I.type==="range")return!1;var _=Rr(E,I);if(!_)return!0;if(_?R=E:(R=E==="v"?"h":"v",_=Rr(E,I)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||S)&&(r.current=R),!R)return!0;var P=r.current||R;return yf(P,b,h,P==="h"?w:S,!0)},[]),f=a.useCallback(function(h){var b=h;if(!(!Te.length||Te[Te.length-1]!==s)){var x="deltaY"in b?Pr(b):lt(b),M=t.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&Rf(R.delta,x)})[0];if(M&&M.should){b.cancelable&&b.preventDefault();return}if(!M){var w=(u.current.shards||[]).map(_r).filter(Boolean).filter(function(R){return R.contains(b.target)}),S=w.length>0?c(b,w[0]):!u.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),p=a.useCallback(function(h,b,x,M){var w={name:h,delta:b,target:x,should:M,shadowParent:Tf(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=a.useCallback(function(h){n.current=lt(h),r.current=void 0},[]),l=a.useCallback(function(h){p(h.type,Pr(h),h.target,c(h,e.lockRef.current))},[]),m=a.useCallback(function(h){p(h.type,lt(h),h.target,c(h,e.lockRef.current))},[]);a.useEffect(function(){return Te.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Ie),document.addEventListener("touchmove",f,Ie),document.addEventListener("touchstart",d,Ie),function(){Te=Te.filter(function(h){return h!==s}),document.removeEventListener("wheel",f,Ie),document.removeEventListener("touchmove",f,Ie),document.removeEventListener("touchstart",d,Ie)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Pf(o)}):null,v?a.createElement(Vr,{gapMode:e.gapMode}):null)}function Tf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Af=Hr(gs,If);var Ms=a.forwardRef(function(e,t){return a.createElement(_t,Q({},e,{ref:t,sideCar:Af}))});Ms.classNames=_t.classNames;const Nf=Ms;var on=["Enter"," "],$f=["ArrowDown","PageUp","Home"],ws=["ArrowUp","PageDown","End"],Of=[...$f,...ws],Df={ltr:[...on,"ArrowRight"],rtl:[...on,"ArrowLeft"]},jf={ltr:["ArrowLeft"],rtl:["ArrowRight"]},et="Menu",[Be,Lf,kf]=dn(et),[ye,Ff]=us(et,[kf,wt,Oe]),tt=wt(),Ss=Oe(),[Es,xe]=ye(et),[Uf,nt]=ye(et),ys=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=tt(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(St,{...c,children:i.jsx(Es,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(Uf,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};ys.displayName=et;var Gf="MenuAnchor",jn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tt(n);return i.jsx(Yr,{...o,...r,ref:t})});jn.displayName=Gf;var Ln="MenuPortal",[Kf,Rs]=ye(Ln,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=xe(Ln,t);return i.jsx(Kf,{scope:t,forceMount:n,children:i.jsx(Qe,{present:n||s.open,children:i.jsx(hs,{asChild:!0,container:o,children:r})})})};Ps.displayName=Ln;var re="MenuContent",[Bf,kn]=ye(re),_s=a.forwardRef((e,t)=>{const n=Rs(re,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xe(re,e.__scopeMenu),u=nt(re,e.__scopeMenu);return i.jsx(Be.Provider,{scope:e.__scopeMenu,children:i.jsx(Qe,{present:r||s.open,children:i.jsx(Be.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Wf,{...o,ref:t}):i.jsx(Vf,{...o,ref:t})})})})}),Wf=a.forwardRef((e,t)=>{const n=xe(re,e.__scopeMenu),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Fn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vf=a.forwardRef((e,t)=>{const n=xe(re,e.__scopeMenu);return i.jsx(Fn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=xe(re,n),x=nt(re,n),M=tt(n),w=Ss(n),S=Lf(n),[R,I]=a.useState(null),E=a.useRef(null),_=U(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Nf:a.Fragment,z=g?{as:vs,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=rp(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),Dr();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&ap(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Bf,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(ps,{asChild:!0,trapped:o,onMountAutoFocus:y(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(ds,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx(pn,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:y(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Xr,{role:"menu","aria-orientation":"vertical","data-state":Vs(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:y(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!Of.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);ws.includes(C.key)&&B.reverse(),tp(B)}),onBlur:y(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:y(e.onPointerMove,We(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});_s.displayName=re;var Hf="MenuGroup",Un=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"group",...r,ref:t})});Un.displayName=Hf;var Yf="MenuLabel",Is=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{...r,ref:t})});Is.displayName=Yf;var vt="MenuItem",Ir="menu.itemSelect",It=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=nt(vt,e.__scopeMenu),c=kn(vt,e.__scopeMenu),f=U(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(Ir,{bubbles:!0,cancelable:!0});l.addEventListener(Ir,v=>r==null?void 0:r(v),{once:!0}),xt(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(Ts,{...o,ref:f,disabled:n,onClick:y(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:y(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:y(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||on.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});It.displayName=vt;var Ts=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=kn(vt,n),c=Ss(n),f=a.useRef(null),p=U(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Be.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(mn,{asChild:!0,...c,focusable:!r,children:i.jsx(F.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:y(e.onPointerMove,We(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,We(g=>u.onItemLeave(g))),onFocus:y(e.onFocus,()=>l(!0)),onBlur:y(e.onBlur,()=>l(!1))})})})}),Xf="MenuCheckboxItem",As=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(js,{scope:e.__scopeMenu,checked:n,children:i.jsx(It,{role:"menuitemcheckbox","aria-checked":gt(n)?"mixed":n,...o,ref:t,"data-state":Bn(n),onSelect:y(o.onSelect,()=>r==null?void 0:r(gt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});As.displayName=Xf;var Ns="MenuRadioGroup",[zf,Zf]=ye(Ns,{value:void 0,onValueChange:()=>{}}),$s=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(zf,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(Un,{...o,ref:t})})});$s.displayName=Ns;var Os="MenuRadioItem",Ds=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Zf(Os,e.__scopeMenu),s=n===o.value;return i.jsx(js,{scope:e.__scopeMenu,checked:s,children:i.jsx(It,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Bn(s),onSelect:y(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});Ds.displayName=Os;var Gn="MenuItemIndicator",[js,qf]=ye(Gn,{checked:!1}),Ls=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=qf(Gn,n);return i.jsx(Qe,{present:r||gt(s.checked)||s.checked===!0,children:i.jsx(F.span,{...o,ref:t,"data-state":Bn(s.checked)})})});Ls.displayName=Gn;var Jf="MenuSeparator",ks=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ks.displayName=Jf;var Qf="MenuArrow",Fs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tt(n);return i.jsx(zr,{...o,...r,ref:t})});Fs.displayName=Qf;var Kn="MenuSub",[ep,Us]=ye(Kn),Gs=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=xe(Kn,t),u=tt(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(St,{...u,children:i.jsx(Es,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(ep,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};Gs.displayName=Kn;var ke="MenuSubTrigger",Ks=a.forwardRef((e,t)=>{const n=xe(ke,e.__scopeMenu),r=nt(ke,e.__scopeMenu),o=Us(ke,e.__scopeMenu),s=kn(ke,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(jn,{asChild:!0,...p,children:i.jsx(Ts,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vs(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,We(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:y(e.onPointerLeave,We(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:y(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Df[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Ks.displayName=ke;var Bs="MenuSubContent",Ws=a.forwardRef((e,t)=>{const n=Rs(re,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xe(re,e.__scopeMenu),u=nt(re,e.__scopeMenu),c=Us(Bs,e.__scopeMenu),f=a.useRef(null),p=U(t,f);return i.jsx(Be.Provider,{scope:e.__scopeMenu,children:i.jsx(Qe,{present:r||s.open,children:i.jsx(Be.Slot,{scope:e.__scopeMenu,children:i.jsx(Fn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:y(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:y(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=jf[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Ws.displayName=Bs;function Vs(e){return e?"open":"closed"}function gt(e){return e==="indeterminate"}function Bn(e){return gt(e)?"indeterminate":e?"checked":"unchecked"}function tp(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function np(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function rp(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=np(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function op(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function ap(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return op(n,t)}function We(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sp=ys,cp=jn,ip=Ps,up=_s,lp=Un,dp=Is,fp=It,pp=As,mp=$s,hp=Ds,vp=Ls,gp=ks,Cp=Fs,bp=Gs,xp=Ks,Mp=Ws,Tt="Menubar",[an,wp,Sp]=dn(Tt),[Hs,Pm]=us(Tt,[Sp,Oe]),Y=Ff(),Ys=Oe(),[Ep,Wn]=Hs(Tt),Xs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:s,loop:u=!0,dir:c,...f}=e,p=Ne(c),d=Ys(n),[l="",m]=$e({prop:r,onChange:o,defaultProp:s}),[v,g]=a.useState(null);return i.jsx(Ep,{scope:n,value:l,onMenuOpen:a.useCallback(h=>{m(h),g(h)},[m]),onMenuClose:a.useCallback(()=>m(""),[m]),onMenuToggle:a.useCallback(h=>{m(b=>b?"":h),g(h)},[m]),dir:p,loop:u,children:i.jsx(an.Provider,{scope:n,children:i.jsx(an.Slot,{scope:n,children:i.jsx(pn,{asChild:!0,...d,orientation:"horizontal",loop:u,dir:p,currentTabStopId:v,onCurrentTabStopIdChange:g,children:i.jsx(F.div,{role:"menubar",...f,ref:t})})})})})});Xs.displayName=Tt;var Vn="MenubarMenu",[yp,zs]=Hs(Vn),Zs=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=ee(),s=n||o||"LEGACY_REACT_AUTO_VALUE",u=Wn(Vn,t),c=Y(t),f=a.useRef(null),p=a.useRef(!1),d=u.value===s;return a.useEffect(()=>{d||(p.current=!1)},[d]),i.jsx(yp,{scope:t,value:s,triggerId:ee(),triggerRef:f,contentId:ee(),wasKeyboardTriggerOpenRef:p,children:i.jsx(sp,{...c,open:d,onOpenChange:l=>{l||u.onMenuClose()},modal:!1,dir:u.dir,...r})})};Zs.displayName=Vn;var sn="MenubarTrigger",qs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,s=Ys(n),u=Y(n),c=Wn(sn,n),f=zs(sn,n),p=a.useRef(null),d=U(t,p,f.triggerRef),[l,m]=a.useState(!1),v=c.value===f.value;return i.jsx(an.ItemSlot,{scope:n,value:f.value,disabled:r,children:i.jsx(mn,{asChild:!0,...s,focusable:!r,tabStopId:f.value,children:i.jsx(cp,{asChild:!0,...u,children:i.jsx(F.button,{type:"button",role:"menuitem",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":v,"aria-controls":v?f.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":v?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:d,onPointerDown:y(e.onPointerDown,g=>{!r&&g.button===0&&g.ctrlKey===!1&&(c.onMenuOpen(f.value),v||g.preventDefault())}),onPointerEnter:y(e.onPointerEnter,()=>{var h;!!c.value&&!v&&(c.onMenuOpen(f.value),(h=p.current)==null||h.focus())}),onKeyDown:y(e.onKeyDown,g=>{r||(["Enter"," "].includes(g.key)&&c.onMenuToggle(f.value),g.key==="ArrowDown"&&c.onMenuOpen(f.value),["Enter"," ","ArrowDown"].includes(g.key)&&(f.wasKeyboardTriggerOpenRef.current=!0,g.preventDefault()))}),onFocus:y(e.onFocus,()=>m(!0)),onBlur:y(e.onBlur,()=>m(!1))})})})})});qs.displayName=sn;var Rp="MenubarPortal",Js=e=>{const{__scopeMenubar:t,...n}=e,r=Y(t);return i.jsx(ip,{...r,...n})};Js.displayName=Rp;var cn="MenubarContent",Qs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,s=Y(n),u=Wn(cn,n),c=zs(cn,n),f=wp(n),p=a.useRef(!1);return i.jsx(up,{id:c.contentId,"aria-labelledby":c.triggerId,"data-radix-menubar-content":"",...s,...o,ref:t,align:r,onCloseAutoFocus:y(e.onCloseAutoFocus,d=>{var m;!!!u.value&&!p.current&&((m=c.triggerRef.current)==null||m.focus()),p.current=!1,d.preventDefault()}),onFocusOutside:y(e.onFocusOutside,d=>{const l=d.target;f().some(v=>{var g;return(g=v.ref.current)==null?void 0:g.contains(l)})&&d.preventDefault()}),onInteractOutside:y(e.onInteractOutside,()=>{p.current=!0}),onEntryFocus:d=>{c.wasKeyboardTriggerOpenRef.current||d.preventDefault()},onKeyDown:y(e.onKeyDown,d=>{if(["ArrowRight","ArrowLeft"].includes(d.key)){const l=d.target,m=l.hasAttribute("data-radix-menubar-subtrigger"),v=l.closest("[data-radix-menubar-content]")!==d.currentTarget,h=(u.dir==="rtl"?"ArrowRight":"ArrowLeft")===d.key;if(!h&&m||v&&h)return;let M=f().filter(R=>!R.disabled).map(R=>R.value);h&&M.reverse();const w=M.indexOf(c.value);M=u.loop?Up(M,w+1):M.slice(w+1);const[S]=M;S&&u.onMenuOpen(S)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});Qs.displayName=cn;var Pp="MenubarGroup",ec=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(lp,{...o,...r,ref:t})});ec.displayName=Pp;var _p="MenubarLabel",tc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(dp,{...o,...r,ref:t})});tc.displayName=_p;var Ip="MenubarItem",nc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(fp,{...o,...r,ref:t})});nc.displayName=Ip;var Tp="MenubarCheckboxItem",rc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(pp,{...o,...r,ref:t})});rc.displayName=Tp;var Ap="MenubarRadioGroup",oc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(mp,{...o,...r,ref:t})});oc.displayName=Ap;var Np="MenubarRadioItem",ac=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(hp,{...o,...r,ref:t})});ac.displayName=Np;var $p="MenubarItemIndicator",sc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(vp,{...o,...r,ref:t})});sc.displayName=$p;var Op="MenubarSeparator",cc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(gp,{...o,...r,ref:t})});cc.displayName=Op;var Dp="MenubarArrow",jp=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(Cp,{...o,...r,ref:t})});jp.displayName=Dp;var Lp="MenubarSub",ic=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,u=Y(t),[c=!1,f]=$e({prop:r,defaultProp:s,onChange:o});return i.jsx(bp,{...u,open:c,onOpenChange:f,children:n})};ic.displayName=Lp;var kp="MenubarSubTrigger",uc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(xp,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});uc.displayName=kp;var Fp="MenubarSubContent",lc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(Mp,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});lc.displayName=Fp;function Up(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dc=Xs,Gp=Zs,fc=qs,pc=Js,Kp=Qs,Bp=ec,Wp=tc,Vp=nc,Hp=rc,Yp=oc,Xp=ac,zp=sc,Zp=cc,qp=ic,Jp=uc,Qp=lc;function em(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Hn="ScrollArea",[mc,_m]=fn(Hn),[tm,oe]=mc(Hn),hc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...u}=e,[c,f]=a.useState(null),[p,d]=a.useState(null),[l,m]=a.useState(null),[v,g]=a.useState(null),[h,b]=a.useState(null),[x,M]=a.useState(0),[w,S]=a.useState(0),[R,I]=a.useState(!1),[E,_]=a.useState(!1),P=U(t,K=>f(K)),N=Ne(o);return i.jsx(tm,{scope:n,type:r,dir:N,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:d,content:l,onContentChange:m,scrollbarX:v,onScrollbarXChange:g,scrollbarXEnabled:R,onScrollbarXEnabledChange:I,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:_,onCornerWidthChange:M,onCornerHeightChange:S,children:i.jsx(F.div,{dir:N,...u,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});hc.displayName=Hn;var vc="ScrollAreaViewport",gc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,u=oe(vc,n),c=a.useRef(null),f=U(t,c,u.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),i.jsx(F.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});gc.displayName=vc;var fe="ScrollAreaScrollbar",Cc=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:u}=o,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):u(!0),()=>{c?s(!1):u(!1)}),[c,s,u]),o.type==="hover"?i.jsx(nm,{...r,ref:t,forceMount:n}):o.type==="scroll"?i.jsx(rm,{...r,ref:t,forceMount:n}):o.type==="auto"?i.jsx(bc,{...r,ref:t,forceMount:n}):o.type==="always"?i.jsx(Yn,{...r,ref:t}):null});Cc.displayName=fe;var nm=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),[s,u]=a.useState(!1);return a.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const p=()=>{window.clearTimeout(f),u(!0)},d=()=>{f=window.setTimeout(()=>u(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),i.jsx(ge,{present:n||s,children:i.jsx(bc,{"data-state":s?"visible":"hidden",...r,ref:t})})}),rm=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),s=e.orientation==="horizontal",u=Nt(()=>f("SCROLL_END"),100),[c,f]=em("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay,f]),a.useEffect(()=>{const p=o.viewport,d=s?"scrollLeft":"scrollTop";if(p){let l=p[d];const m=()=>{const v=p[d];l!==v&&(f("SCROLL"),u()),l=v};return p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,s,f,u]),i.jsx(ge,{present:n||c!=="hidden",children:i.jsx(Yn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:y(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:y(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),bc=a.forwardRef((e,t)=>{const n=oe(fe,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,u]=a.useState(!1),c=e.orientation==="horizontal",f=Nt(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;u(c?p:d)}},10);return Ae(n.viewport,f),Ae(n.content,f),i.jsx(ge,{present:r||s,children:i.jsx(Yn,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Yn=a.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=oe(fe,e.__scopeScrollArea),s=a.useRef(null),u=a.useRef(0),[c,f]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Ec(c.viewport,c.content),d={...r,sizes:c,onSizesChange:f,hasThumb:p>0&&p<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:m=>u.current=m};function l(m,v){return um(m,u.current,c,v)}return n==="horizontal"?i.jsx(om,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,v=Tr(m,c,o.dir);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=l(m,o.dir))}}):n==="vertical"?i.jsx(am,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,v=Tr(m,c);s.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=l(m))}}):null}),om=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=oe(fe,e.__scopeScrollArea),[u,c]=a.useState(),f=a.useRef(null),p=U(t,f,s.onScrollbarXChange);return a.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),i.jsx(Mc,{"data-orientation":"horizontal",...o,ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":At(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,l)=>{if(s.viewport){const m=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),Rc(m,l)&&d.preventDefault()}},onResize:()=>{f.current&&s.viewport&&u&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:bt(u.paddingLeft),paddingEnd:bt(u.paddingRight)}})}})}),am=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=oe(fe,e.__scopeScrollArea),[u,c]=a.useState(),f=a.useRef(null),p=U(t,f,s.onScrollbarYChange);return a.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),i.jsx(Mc,{"data-orientation":"vertical",...o,ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":At(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,l)=>{if(s.viewport){const m=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),Rc(m,l)&&d.preventDefault()}},onResize:()=>{f.current&&s.viewport&&u&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:bt(u.paddingTop),paddingEnd:bt(u.paddingBottom)}})}})}),[sm,xc]=mc(fe),Mc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:u,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:d,onResize:l,...m}=e,v=oe(fe,n),[g,h]=a.useState(null),b=U(t,P=>h(P)),x=a.useRef(null),M=a.useRef(""),w=v.viewport,S=r.content-r.viewport,R=k(d),I=k(f),E=Nt(l,10);function _(P){if(x.current){const N=P.clientX-x.current.left,K=P.clientY-x.current.top;p({x:N,y:K})}}return a.useEffect(()=>{const P=N=>{const K=N.target;(g==null?void 0:g.contains(K))&&R(N,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,g,S,R]),a.useEffect(I,[r,I]),Ae(g,E),Ae(v.content,E),i.jsx(sm,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:k(s),onThumbPointerUp:k(u),onThumbPositionChange:I,onThumbPointerDown:k(c),children:i.jsx(F.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:y(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),x.current=g.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),_(P))}),onPointerMove:y(e.onPointerMove,_),onPointerUp:y(e.onPointerUp,P=>{const N=P.target;N.hasPointerCapture(P.pointerId)&&N.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=M.current,v.viewport&&(v.viewport.style.scrollBehavior=""),x.current=null})})})}),Ct="ScrollAreaThumb",wc=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xc(Ct,e.__scopeScrollArea);return i.jsx(ge,{present:n||o.hasThumb,children:i.jsx(cm,{ref:t,...r})})}),cm=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=oe(Ct,n),u=xc(Ct,n),{onThumbPositionChange:c}=u,f=U(t,l=>u.onThumbChange(l)),p=a.useRef(),d=Nt(()=>{p.current&&(p.current(),p.current=void 0)},100);return a.useEffect(()=>{const l=s.viewport;if(l){const m=()=>{if(d(),!p.current){const v=lm(l,c);p.current=v,c()}};return c(),l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[s.viewport,d,c]),i.jsx(F.div,{"data-state":u.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:y(e.onPointerDownCapture,l=>{const v=l.target.getBoundingClientRect(),g=l.clientX-v.left,h=l.clientY-v.top;u.onThumbPointerDown({x:g,y:h})}),onPointerUp:y(e.onPointerUp,u.onThumbPointerUp)})});wc.displayName=Ct;var Xn="ScrollAreaCorner",Sc=a.forwardRef((e,t)=>{const n=oe(Xn,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(im,{...e,ref:t}):null});Sc.displayName=Xn;var im=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=oe(Xn,n),[s,u]=a.useState(0),[c,f]=a.useState(0),p=!!(s&&c);return Ae(o.scrollbarX,()=>{var l;const d=((l=o.scrollbarX)==null?void 0:l.offsetHeight)||0;o.onCornerHeightChange(d),f(d)}),Ae(o.scrollbarY,()=>{var l;const d=((l=o.scrollbarY)==null?void 0:l.offsetWidth)||0;o.onCornerWidthChange(d),u(d)}),p?i.jsx(F.div,{...r,ref:t,style:{width:s,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bt(e){return e?parseInt(e,10):0}function Ec(e,t){const n=e/t;return isNaN(n)?0:n}function At(e){const t=Ec(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function um(e,t,n,r="ltr"){const o=At(n),s=o/2,u=t||s,c=o-u,f=n.scrollbar.paddingStart+u,p=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,l=r==="ltr"?[0,d]:[d*-1,0];return yc([f,p],l)(e)}function Tr(e,t,n="ltr"){const r=At(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,u=t.content-t.viewport,c=s-r,f=n==="ltr"?[0,u]:[u*-1,0],p=Yc(e,f);return yc([0,u],[0,c])(p)}function yc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rc(e,t){return e>0&&e<t}var lm=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},u=n.left!==s.left,c=n.top!==s.top;(u||c)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Nt(e,t){const n=k(e),r=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(r.current),[]),a.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ae(e,t){const n=k(t);me(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var dm=hc,fm=gc,pm=Cc,mm=wc,hm=Sc;const vm=T(dm,{position:"relative",width:"100%",overflow:"hidden",maxHeight:"inherit",variants:{fullHeight:{true:{height:"100%"}}},defaultVariants:{fullHeight:!0}}),gm=T(fm,{width:"100%",height:"100%",maxHeight:"inherit",borderRadius:"inherit","& > div[style]":{display:"block !important"},variants:{asContainer:{true:{padding:"$1"}}}}),un=4,Ar=T(pm,{display:"flex",userSelect:"none",touchAction:"none",margin:"$0_5",background:"$scrollbarTrack",'&[data-orientation="vertical"]':{width:un},'&[data-orientation="horizontal"]':{flexDirection:"column",height:un},variants:{subtle:{true:{padding:"$0_5 0 $0_5 $0_5",margin:0,background:"transparent","&:hover":{background:"$scrollbarTrackHover"}}}},defaultVariants:{subtle:!0}}),Nr=T(mm,{flex:1,background:"$scrollbarThumb",borderRadius:un,position:"relative","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:8,minHeight:8}}),Cm=T(hm,{backgroundColor:"$scrollbarTrackHover"});function zn(e){const{fullHeight:t,subtle:n,css:r,asContainer:o,...s}=e;return i.jsxs(vm,{fullHeight:t,children:[i.jsx(gm,{css:r,asContainer:o,...s}),i.jsx(Ar,{orientation:"horizontal",subtle:n,children:i.jsx(Nr,{})}),i.jsx(Ar,{orientation:"vertical",subtle:n,children:i.jsx(Nr,{})}),i.jsx(Cm,{})]})}const Zn=T("span",{display:"flex",alignItems:"center","& > svg":{marginRight:"$1_5",width:"$4",height:"$4"}}),bm={context:{Root:cs,Group:kd,Sub:Hd,Portal:is,RadioGroup:T(Kd,$t),MenuLabel:T(Fd,Ot),MenuItem:T(Ud,Dt),Content:T(Ld,Re,nr),SubContent:T(Xd,Re,nr),SubMenuItem:T(Yd,jt),Separator:T(Vd,Lt),CheckboxItem:T(Gd,kt),RadioItem:T(Bd,Ft),ItemIndicator:T(Wd,Ut)},dropdown:{Root:oa,Group:Gu,RadioGroup:T(Vu,$t),Sub:zu,Portal:aa,MenuLabel:T(Ku,Ot),MenuItem:T(Bu,Dt),Content:T(Uu,Re,rr),SubContent:T(qu,Re,rr),SubMenuItem:T(Zu,jt),Separator:T(Xu,Lt),CheckboxItem:T(Wu,kt),RadioItem:T(Hu,Ft),ItemIndicator:T(Yu,Ut)},menubar:{Root:dc,Group:Bp,RadioGroup:T(Yp,$t),Sub:qp,Portal:pc,MenuLabel:T(Wp,Ot),MenuItem:T(Vp,Dt),Content:T(Kp,Re),SubContent:T(Qp,Re),SubMenuItem:T(Jp,jt),Separator:T(Zp,Lt),CheckboxItem:T(Hp,kt),RadioItem:T(Xp,Ft),ItemIndicator:T(zp,Ut)}};function Me(){const e=a.useContext(we),t=bm[e.type];if(!t)throw new Error(`Cannot resolve Primitive Component by type ${e.type}`);return t}const we=a.createContext({type:"dropdown",size:"sm"});we.displayName="MenuContext";const qn=function(t){return i.jsx(we.Provider,{value:{type:t.type,size:t.size},children:t.children})},Im=a.forwardRef(function(t,n){const{icon:r,name:o,shortcuts:s,label:u,disabled:c,onSelect:f,onClick:p,asChild:d,critical:l,children:m,...v}=t,{size:g}=a.useContext(we),{MenuItem:h}=Me();return i.jsx(h,{ref:n,disabled:c,onSelect:f,onClick:p,size:g,critical:l,asChild:d,...v,children:a.isValidElement(m)?m:i.jsxs(a.Fragment,{children:[i.jsxs(Zn,{children:[r,o]}),i.jsx(ai,{shortcuts:s})]})})}),Jn=a.forwardRef(function(t,n){const{Content:r}=Me(),{size:o}=a.useContext(we);return i.jsx(r,{size:o,ref:n,...t})});function Tm(e){const{name:t,icon:n,disabled:r,children:o}=e,{size:s}=a.useContext(we),{SubMenuItem:u,SubContent:c,Sub:f,Portal:p}=Me();return i.jsxs(f,{children:[i.jsxs(u,{size:s,disabled:r,children:[i.jsxs(Zn,{children:[n,t]}),i.jsx(Xc,{size:"12px"})]}),i.jsx(p,{children:i.jsx(c,{children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:o})})})]})}function Am(e){const{Group:t,MenuLabel:n}=Me(),{label:r,divider:o,children:s,...u}=e,c=typeof o=="boolean"&&o?"bottom":o,f=c==="top"||c==="both",p=c==="bottom"||c==="both";return i.jsxs(pe.Fragment,{children:[f&&i.jsx($r,{}),i.jsxs(t,{...u,children:[r&&i.jsx(n,{children:r}),s]}),p&&i.jsx($r,{})]})}function Nm(e){const{name:t,icon:n,...r}=e,{size:o}=a.useContext(we),{CheckboxItem:s,ItemIndicator:u}=Me();return i.jsxs(s,{...r,size:o,children:[i.jsx(u,{children:i.jsx(zc,{})}),i.jsxs(Zn,{children:[n,t]})]})}const xm=T("div",{height:"$1",width:"$1",borderRadius:"$round",backgroundColor:"currentColor"});function Mm(e){const{value:t,onSelect:n,name:r}=e,{RadioItem:o,ItemIndicator:s}=Me();return i.jsxs(o,{value:t,onSelect:n,children:[i.jsx(s,{children:i.jsx(xm,{})}),r]})}function $m(e){const{items:t,label:n,...r}=e,{RadioGroup:o,MenuLabel:s}=Me(),{size:u}=a.useContext(we);return i.jsxs(o,{...r,size:u,children:[n&&i.jsx(s,{children:n}),t.map((c,f)=>i.jsx(Mm,{...c},f))]})}function $r(){const{Separator:e}=Me();return i.jsx(e,{})}function Om(e){const{children:t,portal:n=!0,size:r="sm",side:o,sideOffset:s=4,align:u="start",alignOffset:c,disabled:f=!1,...p}=e;let d=a.Fragment,l;n&&(d=aa,typeof n=="object"&&(l=n));const m=d===a.Fragment?{}:{container:l};return i.jsx(qn,{type:"dropdown",size:r,children:i.jsxs(oa,{modal:!1,...p,children:[i.jsx(Fu,{disabled:f,asChild:!0,children:e.trigger}),i.jsx(d,{...m,children:i.jsx(Jn,{side:o,sideOffset:s,align:u,alignOffset:c,children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:t})})})]})})}function Dm(e){const{trigger:t,size:n="sm",children:r,onOpenChange:o,onPointerDownOutside:s,portal:u=!0,asChild:c,disabled:f=!1,hidden:p}=e;let d=a.Fragment,l;return u&&(d=is,typeof u=="object"&&(l=u)),i.jsx(qn,{type:"context",size:n,children:i.jsxs(cs,{onOpenChange:o,children:[i.jsx(jd,{disabled:f,asChild:c,children:t}),i.jsx(d,{container:l,children:i.jsx(Jn,{hidden:p,onPointerDownOutside:s,children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:r})})})]})})}const wm=T(fc,{all:"unset",display:"flex",height:"$6",alignItems:"center",padding:"0 $2",fontSize:"$sm",outline:"none",cursor:"default",userSelect:"none",borderRadius:"$2","&:hover":{backgroundColor:"$grayA4",color:"$gray12"},"&:focus":{backgroundColor:"$grayA4",color:"$gray12"},"&[data-state=open]":{backgroundColor:"$grayA4",color:"$gray12"}}),Pc=pe.forwardRef((e,t)=>i.jsx(wm,{ref:t,...e}));Pc.displayName=fc.displayName;function jm(e){const{name:t}=e;return i.jsxs(Gp,{children:[i.jsx(Pc,{children:t}),i.jsx(pc,{children:i.jsx(Jn,{align:"start",alignOffset:-4,sideOffset:4,children:e.children})})]})}const Sm=T(dc,{display:"flex",height:"100%",alignItems:"center",padding:"0 $2",flexWrap:"nowrap"});function Lm(e){const{size:t="sm"}=e;return i.jsx(qn,{type:"menubar",size:t,children:i.jsx(Sm,{children:e.children})})}export{Dm as C,Om as D,sr as K,Im as M,Tm as S,Jc as a,Qc as b,ei as c,ai as d,Lm as e,jm as f,$r as g,Nm as h,$m as i,Am as j,zn as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E=Object.defineProperty;var U=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(U(n,typeof e!="symbol"?e+"":e,t),t);import{bW as v,bX as f,bt as g,ae as i,bY as u,aD as c,aV as b,O as y,bZ as T,j as m,e as x,n as C}from"./index-0a8702e2.js";import{a as V}from"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import{F as d}from"./index-98982ce2.js";import{M}from"./MeshThumbnail-49273f71.js";import{A}from"./AssetViewer-bc198e16.js";import{e as N}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";class O{static createMesh(e,t){const s=new v(e);return O.setMeshData(s,t),s}static setMeshData(e,t){var s,r;return e.setPositions([...t.positions]),e.setNormals(t.normals),e.setUVs(t.uvs),t.uv1&&e.setUVs(t.uv1,1),t.uv2&&e.setUVs(t.uv2,2),t.uv3&&e.setUVs(t.uv3,3),t.uv4&&e.setUVs(t.uv4,4),t.uv5&&e.setUVs(t.uv5,5),t.uv6&&e.setUVs(t.uv6,6),t.uv7&&e.setUVs(t.uv7,7),t.bounds?(e.bounds.min.copyFrom(t.bounds.min),e.bounds.max.copyFrom(t.bounds.max)):O.calculateBounds(t.positions,e.bounds),(s=t.blendShapes)==null||s.forEach(o=>{const l=new f(o.name);o.frames.forEach(a=>{l.addFrame(a.weight,a.positions,a.normals,a.uvs)}),e.addBlendShape(l)}),(r=t.subMeshes)==null||r.forEach(o=>{e.addSubMesh(o)}),t.indices&&(t.positions.length<=65535?e.setIndices(new Uint16Array(t.indices)):e.setIndices(new Uint32Array(t.indices))),e.uploadData(!1),e}static calculateBounds(e,t){const{min:s,max:r}=t,o=e.length;s.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<o;l++){const a=e[l];s.x=Math.min(a.x,s.x),s.y=Math.min(a.y,s.y),s.z=Math.min(a.z,s.z),r.x=Math.max(a.x,r.x),r.y=Math.max(a.y,r.y),r.z=Math.max(a.z,r.z)}}}class R extends g{constructor(e,t){super(e),this.meshData=t}restoreContent(){O.setMeshData(this.resource,this.meshData)}}var p=(n=>(n.POSITION="Position",n.NORMAL="Normal",n.COLOR_0="Color",n.TANGENT="Tangent",n.WEIGHTS_0="BoneWeight",n.JOINTS_0="BoneIndex",n.TEXCOORD_0="UV",n.TEXCOORD_1="UV1",n.TEXCOORD_2="UV2",n.TEXCOORD_3="UV3",n.TEXCOORD_4="UV4",n.TEXCOORD_5="UV5",n.TEXCOORD_6="UV6",n.TEXCOORD_7="UV7",n))(p||{});const X=["POSITION","NORMAL","COLOR_0","TANGENT","WEIGHTS_0","JOINTS_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","TEXCOORD_3","TEXCOORD_4","TEXCOORD_5","TEXCOORD_6","TEXCOORD_7"],L={[i.Float]:"4 bytes",[i.Vector2]:"8 bytes",[i.Vector3]:"12 bytes",[i.Vector4]:"16 bytes",[i.Byte4]:"4 bytes",[i.UByte4]:"4 bytes",[i.NormalizedByte4]:"4 bytes",[i.NormalizedUByte4]:"4 bytes",[i.NormalizedShort2]:"4 bytes",[i.NormalizedShort4]:"8 bytes",[i.Short2]:"4 bytes",[i.UShort2]:"4 bytes",[i.NormalizedUShort2]:"4 bytes",[i.Short4]:"8 bytes",[i.UShort4]:"8 bytes",[i.NormalizedUShort4]:"8 bytes"};u.Triangles+"",u.TriangleStrip+"",u.TriangleFan+"",u.LineLoop+"",u.LineStrip+"",u.Lines+"",u.Points+"";function w(n){switch(n.topology){case u.Triangles:return`${n.count/3} triangles`;case u.TriangleFan:case u.TriangleStrip:return`${n.count-2} triangles`;case u.Lines:return`${n.count/2} lines`;case u.LineStrip:return`${n.count-1} lines`;case u.LineLoop:return`${n.count} lines`;case u.Points:return`${n.count} points`}}function I(n){if(n instanceof Uint8Array)return"Uint8";if(n instanceof Uint16Array)return"Uint16";if(n instanceof Uint32Array)return"Uint32"}const S=n=>{const e=n.asset.engineObject,t=e.vertexCount,s=e.getIndices(),r=e.subMeshes;return c.jsxs(c.Fragment,{children:[c.jsx(b,{title:`Vertices: ${t}`,defaultOpen:!0,children:X.map(o=>e.vertexElements.find(l=>l.semantic===o)).filter(o=>o!=null).map(o=>c.jsx(d,{label:p[o.attribute],value:`${i[o.format]} (${L[o.format]})`},o.attribute))}),s?c.jsx(b,{title:`Indices: ${s.length}`,defaultOpen:!0,children:c.jsx(d,{label:"Format",value:I(s)})}):null,c.jsx(b,{title:`SubMesh: ${r.length}`,defaultOpen:!0,children:r.map((o,l)=>c.jsx(d,{label:`# ${l}`,value:w(o)},l))})]})};class j extends A{setViewAsset(e,t){const s=t.createChild("mesh_entity"),r=s.addComponent(y);r.mesh=e.engineObject;const o=new T(e.engine);o.baseColor.set(.5,.5,.5,1),r.setMaterial(o),this._entity=s}}var B=Object.defineProperty,F=Object.getOwnPropertyDescriptor,z=(n,e,t,s)=>{for(var r=s>1?void 0:s?F(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&B(e,t,r),r};let h=class extends m{constructor(e){super(e);_(this,"meshData",null)}beforeDelete(){return null}afterDelete(){return null}async initByMain(e){const{engine:t}=this,s=JSON.parse(await e.text());this.meshData=s;const r=new v(t);O.setMeshData(r,s),t.resourceManager.addContentRestorer(new R(r,s)),this.bindEngineObject(r),this._releaseMeshCache()}initByEngineObject(e){this.bindEngineObject(e),this._name=e.name,this.meshData={positions:[],subMeshes:[]}}_releaseMeshCache(){const e=this.engineObject;e._verticesUint8=null,e._indices=null,e._verticesFloat32=null,e._positions=null,e._tangents=null,e._normals=null,e._colors=null,e._uv=null,e._uv1=null,e._uv2=null,e._uv3=null,e._uv4=null,e._uv5=null,e._uv6=null,e._uv7=null}};h=z([V({type:"Mesh",label:x("asset.mesh.title"),icon:{},loaderType:"Mesh",extname:"mesh",customInspector:S,viewer:j,thumbnail:M,dragLayer:C.Mesh,async bundle({content:n}){const e=JSON.parse(await n.text()),t=N(e,{type:"Mesh",name:"mesh"});return{content:new Blob([t])}}})],h);export{h as MeshAsset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var f=(e,r,t)=>r in e?c(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var s=(e,r,t)=>(f(e,typeof r!="symbol"?r+"":r,t),t);import{p as n,C as d,s as p,f as u,w as v,E as b,v as y,u as P,J as w}from"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./AssetPreviewer-24e31d97.js";var M=Object.defineProperty,O=Object.getOwnPropertyDescriptor,i=(e,r,t,l)=>{for(var a=l>1?void 0:l?O(r,t):r,h=e.length-1,m;h>=0;h--)(m=e[h])&&(a=(l?m(r,t,a):m(a))||a);return l&&a&&M(r,t,a),a};class o extends b{constructor(){super(...arguments);s(this,"mesh",null);s(this,"material",{refId:"0000200"});s(this,"receiveShadows",!0);s(this,"castShadows",!0);s(this,"priority",0);s(this,"materialOpen",!1)}setMaterialOpen(t){this.materialOpen=t}}i([n({type:d.AssetPicker,assetType:["Mesh"],label:"mesh-renderer.mesh.title",info:"mesh-renderer.mesh.info",bindPath:"mesh"}),p()],o.prototype,"mesh",2);i([n({type:d.AssetPicker,assetType:"Material",label:"mesh-renderer.material.title",info:"mesh-renderer.material.info",customFilter:e=>{var r;return((r=e.engineObject.shader)==null?void 0:r.name)!=="particle-shader"}}),u({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:v.ReferResource,getEngineValue:e=>e.getMaterial()}),p({type:"methods",key:"setMaterial",onSerialize:e=>e?[[e]]:void 0,onDeserialize(e){return e?e[0][0]:void 0}})],o.prototype,"material",2);i([n({label:"mesh-renderer.receive-shadows.title",info:"mesh-renderer.receive-shadows.info",bindPath:"receiveShadows"}),y(),p()],o.prototype,"receiveShadows",2);i([n({label:"mesh-renderer.cast-shadows.title",info:"mesh-renderer.cast-shadows.info",bindPath:"castShadows"}),y(),p()],o.prototype,"castShadows",2);i([n({label:"mesh-renderer.priority.title",info:"mesh-renderer.priority.info",bindPath:"priority"}),p()],o.prototype,"priority",2);i([P],o.prototype,"materialOpen",2);i([w],o.prototype,"setMaterialOpen",1);export{o as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as l}from"./InstanceEditorAsset-a70e73fe.js";import{aT as f,aJ as i,aD as m,aY as h,p as d}from"./index-0a8702e2.js";import"./AssetPreviewer-24e31d97.js";import{c as u}from"./Component-f923abb1.js";import{c as M}from"./createOnModelChange-b57a0da8.js";import{R}from"./ReferencedMaterial-a87818f3.js";import{M as v}from"./MeshRendererBaseComponent-3a0e09ed.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./MaterialInspector-aec1248b.js";import"./IconPointFilled-a304fd34.js";const x=f(function(o){const[r,s]=i.useState(null),e=o.data,{assetStore:t,inspectorFacade:n}=l();return i.useEffect(()=>{t.getAssetByRef(e.material).then(a=>{s(a)})},[e.material]),m.jsxs(m.Fragment,{children:[m.jsx(h.List,{model:e,configs:e.formSchema.items,onModelChange:M("component",e.id,n,e)}),r&&m.jsx(R,{materialAsset:r})]})});var C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,c=(o,r,s,e)=>{for(var t=e>1?void 0:e?j(r,s):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(e?a(r,s,t):a(t))||t);return e&&t&&C(r,s,t),t};let p=class extends v{constructor(o,r){super(o,r)}};c([d({assetType:["PrimitiveMesh","Mesh"]})],p.prototype,"mesh",2);p=c([u({type:"MeshRenderer",customInspector:x,componentsMenu:{label:"component.renderer.mesh.title"}})],p);export{p as MeshRendererComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=Object.defineProperty;var c=(i,e,t)=>e in i?r(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>(c(i,typeof e!="symbol"?e+"":e,t),t);import{O as h,Q as o,B as d}from"./index-0a8702e2.js";class a{static update(e,t){this.entity?this.entity.isActive=!0:this.initScene(e),this.meshRenderer.mesh=t.engineObject}static clear(){this.entity.isActive=!1}static initScene(e){const t=this.entity=e.createChild("mesh");t.transform.setRotation(16,-47.4,-16.7),this.meshRenderer=t.addComponent(h);const s=new o(e.engine);s.baseColor.set(.7,.7,.7,1),s.metallic=0,s.renderFace=d.Double,this.meshRenderer.setMaterial(s)}}n(a,"entity"),n(a,"meshRenderer");export{a as M};
|