@mohsinonxrm/pptb-commandbar-studio 0.8.0-beta.1 → 0.9.0-beta.1
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/CHANGELOG.md +564 -0
- package/README.md +71 -48
- package/SECURITY.md +12 -7
- package/dist/assets/BulkPublishModal-DzDZJg0U.js +36 -0
- package/dist/assets/CommandEditorPanel-DsCP9yG4.js +1 -0
- package/dist/assets/CommandPalette-ID3kRJ9l.js +1 -0
- package/dist/assets/CompareView-DGsrcdoN.js +7 -0
- package/dist/assets/CrmParameterEditor-C22QGWff.js +1 -0
- package/dist/assets/EditorDrawer-CvCe9WeO.js +2 -0
- package/dist/assets/HideInsteadOfDeleteModal-3j9g-E9l.js +1 -0
- package/dist/assets/IconPickerModal-BLoDLbLR.js +1 -0
- package/dist/assets/ImportXmlModal-BD-L1QzJ.js +1 -0
- package/dist/assets/{MonacoEditor-uzfuRCpJ.js → MonacoEditor-BMKRZv-g.js} +1 -1
- package/dist/assets/NewButtonModal-COYXwEyk.js +1 -0
- package/dist/assets/NewGroupModal-boP_t1fI.js +1 -0
- package/dist/assets/NewTabModal-BI4afbC5.js +1 -0
- package/dist/assets/RuleEditorPanel-l8QnRFj6.js +1 -0
- package/dist/assets/ScriptView-BVyCmRvD.js +1 -0
- package/dist/assets/TabDisplayRulesPanel-gORq6MO7.js +1 -0
- package/dist/assets/TranslationsView-DubBATog.js +1 -0
- package/dist/assets/WebResourceBrowser-BATScmTw.js +1 -0
- package/dist/assets/XmlView-Bn4KlTw3.js +2 -0
- package/dist/assets/dnd-C1w9VFfC.js +5 -0
- package/dist/assets/fluent-icons-CQEhzzaC.js +1 -0
- package/dist/assets/fluent-ui-BEjALNLO.js +59 -0
- package/dist/assets/index-6so8O90C.js +136 -0
- package/dist/assets/index-D5GCH8nj.css +1 -0
- package/dist/assets/ruleKinds-BKTUiZ1-.js +1 -0
- package/dist/assets/useReplaceWebResourceConfirm-DND-V0vw.js +1 -0
- package/dist/assets/useStableKeys-BkDn7til.js +1 -0
- package/dist/assets/{xmlValidator-BkeotXuB.js → xmlValidator-PbODaIQV.js} +1 -1
- package/dist/index.html +15 -9
- package/index.html +10 -4
- package/package.json +1 -1
- package/dist/assets/BulkPublishModal-mJ41AWew.js +0 -36
- package/dist/assets/CommandEditorPanel-BiP1kPHY.js +0 -1
- package/dist/assets/CommandPalette-q51_0qRZ.js +0 -1
- package/dist/assets/ConflictDrawer-CdWv_PbN.js +0 -1
- package/dist/assets/DiffViewer-BQP5f73U.js +0 -7
- package/dist/assets/HideInsteadOfDeleteModal-C9r6ah5p.js +0 -1
- package/dist/assets/IconPickerModal-B81Tnf5i.js +0 -1
- package/dist/assets/ImportXmlModal-C0cMaS59.js +0 -1
- package/dist/assets/LocalizationEditor-DniDtrZV.js +0 -1
- package/dist/assets/NewButtonModal-BXpX1Ld5.js +0 -1
- package/dist/assets/NewGroupModal-Bh7lXq52.js +0 -1
- package/dist/assets/NewTabModal-Pntdk3in.js +0 -1
- package/dist/assets/RuleEditorPanel-BUGKgc0N.js +0 -1
- package/dist/assets/ScalingEditorPanel-p3-Yw3CO.js +0 -1
- package/dist/assets/TabDisplayRulesPanel-CSNshwaw.js +0 -1
- package/dist/assets/UrlComposerModal-WKSTwUcW.js +0 -1
- package/dist/assets/WebResourceBrowser-BK-gVU2g.js +0 -1
- package/dist/assets/XmlDrawer-CQJElnD1.js +0 -2
- package/dist/assets/dnd-Cq8OftAq.js +0 -5
- package/dist/assets/fluent-icons-BqJj6rDi.js +0 -1
- package/dist/assets/fluent-ui-QADO660t.js +0 -43
- package/dist/assets/index-D9lerlVA.css +0 -1
- package/dist/assets/index-Di2_5czx.js +0 -136
- package/dist/assets/ruleKinds-B9hACGaq.js +0 -1
- package/dist/assets/useReplaceWebResourceConfirm-BUWBVNSC.js +0 -1
- package/dist/assets/useStableKeys-p2OkzZWO.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as e,z as L,h as U,cq as X}from"./fluent-icons-BqJj6rDi.js";import{a as F,R as re}from"./monaco-BIO15LCS.js";import{a as P,u as O}from"./index-Di2_5czx.js";import{R as ie,i as te,a as V}from"./ruleKinds-B9hACGaq.js";import{b as f,t as s,I as m,d as k,B as K,F as t,S as p,an as w,P as q,c as Q,e as Y,ai as se,aj as oe,ak as ce,al as ue,M as de,f as pe,a7 as H}from"./fluent-ui-QADO660t.js";import{C as he,u as me}from"./useStableKeys-p2OkzZWO.js";import{D as xe,c as ye,S as ve,v as je,f as ge,g as Re,C as be}from"./dnd-Cq8OftAq.js";import"./crmParameters-rgfZhhzN.js";const fe=L({root:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS},search:{marginBottom:s.spacingVerticalXS},group:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXXS},groupLabel:{color:s.colorNeutralForeground3,paddingTop:s.spacingVerticalXS},kindButton:{justifyContent:"flex-start",textAlign:"left"}});function Ce(l){switch(l){case"CommandClientTypeRule":return{kind:l,type:"Modern"};case"CrmClientTypeRule":return{kind:l,type:"Web"};case"FormStateRule":return{kind:l,state:"Existing"};case"FormTypeRule":return{kind:l,type:"Main"};case"SelectionCountRule":return{kind:l,minimum:1};case"EntityRule":return{kind:l};case"CustomRule":return{kind:l,library:"$webresource:",functionName:""};case"ValueRule":return{kind:l,field:"",value:""};case"SkuRule":return{kind:l,sku:"Online"};case"OrRule":return{kind:l,groups:[[{kind:"FormStateRule",state:"Existing"}],[{kind:"FormStateRule",state:"Create"}]]};case"FeatureControlRule":return{kind:l,featureControlBit:"",expectedValue:!0};case"OrganizationSettingRule":return{kind:l,setting:"IsSharepointEnabled"};case"EntityPrivilegeRule":return{kind:l,privilegeType:"Read",privilegeDepth:"Basic"};case"EntityPropertyRule":return{kind:l,propertyName:"IsCustomizable",propertyValue:!0};case"RecordPrivilegeRule":return{kind:l,privilegeType:"Read"};case"RelationshipTypeRule":return{kind:l,appliesTo:"SelectedEntity"};case"MiscellaneousPrivilegeRule":return{kind:l,privilegeName:"ExportToExcel"};case"FormEntityContextRule":return{kind:l,entityName:""};case"PageRule":return{kind:l,address:""};case"CrmOfflineAccessStateRule":return{kind:l,state:"Online"};case"CrmOutlookClientTypeRule":return{kind:l,type:"CrmForOutlook"};case"CrmOutlookClientVersionRule":return{kind:l,major:15,minor:0,build:0,revision:0};case"DeviceTypeRule":return{kind:l,type:"Web"};case"OptionSetRule":return{kind:l,optionSet:"",stateCode:"",objectTypeCode:""};case"OutlookItemTrackingRule":return{kind:l,trackedInCrm:!0};case"OutlookRenderTypeRule":return{kind:l,type:"Web"};case"OutlookVersionRule":return{kind:l,version:"2010"};case"HideForTabletExperienceRule":return{kind:l};case"ReferencingAttributeRequiredRule":return{kind:l};default:return{kind:l}}}const J=({onSelect:l,container:c,insideOr:d=!1})=>{const h=fe(),[u,E]=F.useState(""),T=ie.map(v=>({...v,kinds:v.kinds.filter(j=>{if(c&&!te(j,c,d)||d&&j==="OrRule")return!1;const N=V[j]??j;return!u||N.toLowerCase().includes(u.toLowerCase())||j.toLowerCase().includes(u.toLowerCase())})})).filter(v=>v.kinds.length>0);return e.jsxs("div",{className:h.root,children:[e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Quick action rules are OOB references and should be bound by ID (for example, Mscrm.ShowOnQuickAction), not created as custom step kinds."}),e.jsx(m,{className:h.search,placeholder:"Search rule kinds…",value:u,onChange:(v,j)=>E(j.value)}),T.map(v=>e.jsxs("div",{className:h.group,children:[e.jsx(f,{size:100,weight:"semibold",className:h.groupLabel,children:v.label}),v.kinds.map(j=>e.jsx(k,{appearance:"subtle",className:h.kindButton,onClick:()=>l(Ce(j)),children:V[j]??j},j))]},v.label))]})},Se=L({step:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,padding:s.spacingVerticalS,border:`1px solid ${s.colorNeutralStroke2}`,borderRadius:s.borderRadiusMedium,backgroundColor:s.colorNeutralBackground2},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},kindBadge:{flexShrink:0},fields:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS},row:{display:"flex",gap:s.spacingHorizontalS,alignItems:"flex-end",flexWrap:"wrap"},nested:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,paddingLeft:s.spacingHorizontalM,borderLeft:`2px solid ${s.colorBrandStroke2}`},nestedToolbar:{display:"flex",alignItems:"center",gap:s.spacingHorizontalXS},pickerSurface:{minWidth:"300px",maxHeight:"50vh",overflowY:"auto",padding:s.spacingVerticalS}}),G=["Create","Read","Write","Delete","Assign","Share","Append","AppendTo"],W=["None","Basic","Local","Deep","Global"],Ee=["DuplicateDetectionEnabled","GridFiltersEnabled","HasStateCode","IsConnectionsEnabled","MailMergeEnabled","WorksWithQueue","HasActivities","IsActivity","HasNotes","IsCustomizable","IsActivityParty","HasEmailAddresses","IsChildEntity","IsImportable","IsEnabledForCharts","IsBusinessProcessEnabled","HasFeedback","IsBPFEntity"],Te=["ExportToExcel","MailMerge","GoOffline","OfflineSynchronize","PublishReports"],Z=({step:l,onChange:c,onRemove:d,container:h})=>{const u=Se(),[E,T]=re.useState(null),v=l.kind!=="OrRule"&&l.kind!=="RawRule",j=v?l.invertResult:void 0,N=v?l.default:void 0,r=a=>{c({...l,...a})},$=a=>{if(!a.trim())return;const n=parseInt(a,10);return Number.isNaN(n)?void 0:n},A=()=>{switch(l.kind){case"CommandClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Modern",children:"Modern (Unified Interface: web, tablets and phones)"}),e.jsx("option",{value:"Refresh",children:"Refresh (legacy updated web client)"}),e.jsx("option",{value:"Legacy",children:"Legacy (classic ribbon + Outlook list views)"})]})});case"CrmClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"})]})});case"FormStateRule":return e.jsx(t,{label:"State",children:e.jsx(p,{value:l.state,onChange:(a,n)=>r({state:n.value}),children:["Create","Existing","ReadOnly","Disabled","BulkEdit"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"FormTypeRule":return e.jsx(t,{label:"Type",children:e.jsx(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:["Main","Preview","AppointmentBook","Dashboard","Quick","QuickCreate","Card","MainInteractionCentric"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"SelectionCountRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Minimum",children:e.jsx(m,{type:"number",value:String(l.minimum??""),onChange:(a,n)=>r({minimum:$(n.value)}),style:{width:"80px"}})}),e.jsx(t,{label:"Maximum",children:e.jsx(m,{type:"number",value:String(l.maximum??""),onChange:(a,n)=>r({maximum:$(n.value)}),style:{width:"80px"}})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})})]});case"EntityRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity name",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Context",children:e.jsxs(p,{value:l.context??"",onChange:(a,n)=>r({context:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"Form",children:"Form"}),e.jsx("option",{value:"HomePageGrid",children:"HomePageGrid"}),e.jsx("option",{value:"SubGridStandard",children:"SubGridStandard"}),e.jsx("option",{value:"SubGridAssociated",children:"SubGridAssociated"})]})})]});case"FormEntityContextRule":return e.jsx(t,{label:"Entity name",children:e.jsx(m,{value:l.entityName,onChange:(a,n)=>r({entityName:n.value})})});case"CustomRule":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Library ($webresource:)",children:e.jsx(m,{value:l.library,onChange:(a,n)=>r({library:n.value}),placeholder:"$webresource:..."})}),e.jsx(t,{label:"Function name",children:e.jsx(m,{value:l.functionName,onChange:(a,n)=>r({functionName:n.value})})})]}),e.jsx(t,{label:"Parameters",children:e.jsx(he,{params:l.params??[],onChange:a=>r({params:a.length?a:void 0})})}),e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Async support: on Unified Interface, custom rules can return Promise<boolean>; unresolved promises default to false after 10 seconds."})]});case"CrmOfflineAccessStateRule":return e.jsx(t,{label:"State",children:e.jsxs(p,{value:l.state,onChange:(a,n)=>r({state:n.value}),children:[e.jsx("option",{value:"Online",children:"Online"}),e.jsx("option",{value:"Offline",children:"Offline"})]})});case"CrmOutlookClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"CrmForOutlook",children:"CrmForOutlook"}),e.jsx("option",{value:"CrmForOutlookOfflineAccess",children:"CrmForOutlookOfflineAccess"})]})});case"CrmOutlookClientVersionRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Major",children:e.jsx(m,{type:"number",value:String(l.major),onChange:(a,n)=>r({major:$(n.value)??l.major}),style:{width:"84px"}})}),e.jsx(t,{label:"Minor",children:e.jsx(m,{type:"number",value:String(l.minor??""),onChange:(a,n)=>r({minor:$(n.value)}),style:{width:"84px"}})}),e.jsx(t,{label:"Build",children:e.jsx(m,{type:"number",value:String(l.build??""),onChange:(a,n)=>r({build:$(n.value)}),style:{width:"84px"}})}),e.jsx(t,{label:"Revision",children:e.jsx(m,{type:"number",value:String(l.revision??""),onChange:(a,n)=>r({revision:$(n.value)}),style:{width:"84px"}})})]});case"DeviceTypeRule":return e.jsx(t,{label:"Device type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"None",children:"None"}),e.jsx("option",{value:"Phone",children:"Phone"}),e.jsx("option",{value:"Tablet",children:"Tablet"}),e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"}),e.jsx("option",{value:"InteractionCentric",children:"InteractionCentric"})]})});case"EntityPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity (optional)",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Privilege",children:e.jsx(p,{value:l.privilegeType,onChange:(a,n)=>r({privilegeType:n.value}),children:G.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(t,{label:"Depth",children:e.jsx(p,{value:l.privilegeDepth,onChange:(a,n)=>r({privilegeDepth:n.value}),children:W.map(a=>e.jsx("option",{value:a,children:a},a))})})]});case"EntityPropertyRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity (optional)",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Property",children:e.jsx(p,{value:l.propertyName,onChange:(a,n)=>r({propertyName:n.value}),children:Ee.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(w,{label:"Property value",checked:l.propertyValue,onChange:(a,n)=>r({propertyValue:n.checked===!0})})]});case"ValueRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Field",children:e.jsx(m,{value:l.field,onChange:(a,n)=>r({field:n.value})})}),e.jsx(t,{label:"Value",children:e.jsx(m,{value:l.value,onChange:(a,n)=>r({value:n.value})})})]});case"OrRule":{const a=g=>c({...l,groups:g.filter(R=>R.length>0)}),n=(g,R)=>e.jsxs(q,{open:E===g,onOpenChange:(x,o)=>T(o.open?g:null),children:[e.jsx(Q,{children:e.jsx(k,{icon:e.jsx(X,{}),appearance:"secondary",size:"small",children:R})}),e.jsx(Y,{className:u.pickerSurface,children:e.jsx(J,{container:h,insideOr:!0,onSelect:x=>{a(g==="new"?[...l.groups,[x]]:l.groups.map((o,b)=>b===g?[...o,x]:o)),T(null)}})})]});return e.jsxs("div",{className:u.nested,children:[l.groups.map((g,R)=>e.jsxs("div",{className:u.nested,children:[e.jsxs(f,{size:100,weight:"semibold",children:[R===0?"Either":"Or",g.length>1?" (all of)":""]}),g.map((x,o)=>e.jsx(Z,{step:x,container:h,onChange:b=>a(l.groups.map((C,_)=>_===R?C.map((I,M)=>M===o?b:I):C)),onRemove:()=>a(l.groups.map((b,C)=>C===R?b.filter((_,I)=>I!==o):b))},`${R}-${o}-${x.kind}`)),e.jsx("div",{className:u.nestedToolbar,children:n(R,"And…")})]},R)),e.jsxs("div",{className:u.nestedToolbar,children:[n("new","Add Or branch"),e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"An OrRule needs at least two branches."})]})]})}case"FeatureControlRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Feature control bit",children:e.jsx(m,{value:l.featureControlBit,onChange:(a,n)=>r({featureControlBit:n.value})})}),e.jsx(w,{label:"Expected value",checked:l.expectedValue,onChange:(a,n)=>r({expectedValue:n.checked===!0})})]});case"RawRule":return e.jsxs(e.Fragment,{children:[e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Command Bar Studio doesn't edit this rule; it is kept exactly as loaded."}),e.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",fontSize:"11px"},children:l.xml})]});case"SkuRule":return e.jsx(t,{label:"SKU",children:e.jsxs(p,{value:l.sku,onChange:(a,n)=>r({sku:n.value}),children:[e.jsx("option",{value:"Online",children:"Online"}),e.jsx("option",{value:"OnPremise",children:"OnPremise"}),e.jsx("option",{value:"Spla",children:"Spla"})]})});case"OrganizationSettingRule":return e.jsx(t,{label:"Setting",children:e.jsx(p,{value:l.setting,onChange:(a,n)=>r({setting:n.value}),children:["IsSharepointEnabled","IsSOPIntegrationEnabled","IsFiscalCalendarDefined","IsReadFormModeDefined","IsBPFEntityCustomizationFeatureEnabled"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"MiscellaneousPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsxs(t,{label:"Privilege name",children:[e.jsx(m,{value:l.privilegeName,onChange:(a,n)=>r({privilegeName:n.value}),placeholder:"ExportToExcel",list:"misc-privilege-suggestions"}),e.jsx("datalist",{id:"misc-privilege-suggestions",children:Te.map(a=>e.jsx("option",{value:a},a))})]}),e.jsx(t,{label:"Depth (optional)",children:e.jsxs(p,{value:l.privilegeDepth??"",onChange:(a,n)=>r({privilegeDepth:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),W.map(a=>e.jsx("option",{value:a,children:a},a))]})})]});case"OptionSetRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Option set",children:e.jsx(m,{value:l.optionSet,onChange:(a,n)=>r({optionSet:n.value})})}),e.jsx(t,{label:"State code",children:e.jsx(m,{value:l.stateCode,onChange:(a,n)=>r({stateCode:n.value})})}),e.jsx(t,{label:"Object type code",children:e.jsx(m,{value:l.objectTypeCode,onChange:(a,n)=>r({objectTypeCode:n.value})})})]});case"OutlookItemTrackingRule":return e.jsxs("div",{className:u.row,children:[e.jsx(w,{label:"Tracked in CRM",checked:l.trackedInCrm,onChange:(a,n)=>r({trackedInCrm:n.checked===!0})}),e.jsx(t,{label:"Applies To",children:e.jsx(p,{value:l.appliesTo??"PrimaryEntity",onChange:(a,n)=>r({appliesTo:n.value}),children:e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"})})})]});case"OutlookRenderTypeRule":return e.jsx(t,{label:"Render type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"})]})});case"OutlookVersionRule":return e.jsx(t,{label:"Outlook version",children:e.jsxs(p,{value:l.version,onChange:(a,n)=>r({version:n.value}),children:[e.jsx("option",{value:"2003",children:"2003"}),e.jsx("option",{value:"2007",children:"2007"}),e.jsx("option",{value:"2010",children:"2010"})]})});case"PageRule":return e.jsx(t,{label:"Address pattern",children:e.jsx(m,{value:l.address,onChange:(a,n)=>r({address:n.value}),placeholder:"main.aspx"})});case"RecordPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Privilege",children:e.jsx(p,{value:l.privilegeType,onChange:(a,n)=>r({privilegeType:n.value}),children:G.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"})]})})]});case"RelationshipTypeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Applies To",children:e.jsx(p,{value:l.appliesTo,disabled:!0,children:e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})})}),e.jsx(t,{label:"Relationship type",children:e.jsxs(p,{value:l.relationshipType??"",onChange:(a,n)=>r({relationshipType:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"OneToMany",children:"OneToMany"}),e.jsx("option",{value:"ManyToMany",children:"ManyToMany"}),e.jsx("option",{value:"NoRelationship",children:"NoRelationship"})]})}),e.jsx(w,{label:"Allow custom relationship",checked:l.allowCustomRelationship===!0,onChange:(a,n)=>r({allowCustomRelationship:n.checked===!0})}),e.jsx(w,{label:"Allow system relationship",checked:l.allowSystemRelationship===!0,onChange:(a,n)=>r({allowSystemRelationship:n.checked===!0})})]});default:return e.jsxs(f,{size:200,italic:!0,style:{color:s.colorNeutralForeground3},children:[l.kind," — no additional parameters"]})}};return e.jsxs("div",{className:u.step,role:"listitem",children:[e.jsxs("div",{className:u.header,children:[e.jsx(K,{appearance:"outline",size:"small",className:u.kindBadge,children:V[l.kind]??l.kind}),e.jsx(k,{appearance:"subtle",icon:e.jsx(U,{}),size:"small",onClick:d,"aria-label":`Remove ${l.kind} step`})]}),e.jsxs("div",{className:u.fields,children:[A(),e.jsx("div",{className:u.row,children:v&&e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Default",title:"Value the rule returns when it cannot be evaluated.",children:e.jsxs(p,{value:N===void 0?"":String(N),onChange:(a,n)=>r({default:n.value===""?void 0:n.value==="true"}),children:[e.jsx("option",{value:"",children:"(not set)"}),e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]})}),e.jsx(w,{label:"Invert result",checked:j===!0,title:"Reverse the evaluated result.",onChange:(a,n)=>r({invertResult:n.checked===!0?!0:void 0})})]})})]})]})};function Ne(l){return l.length===0?"No steps defined — a rule needs at least one before it can be published.":l.map(B).join(" AND ")}function B(l){const c="invertResult"in l&&l.invertResult?"NOT ":"";switch(l.kind){case"SelectionCountRule":{const d=l.minimum!==void 0?`at least ${l.minimum}`:null,h=l.maximum!==void 0?`at most ${l.maximum}`:null,u=[d,h].filter(Boolean).join(" and "),E=l.appliesTo?` (${l.appliesTo})`:"";return`${c}Selection count is ${u}${E}`}case"EntityRule":{const d=l.entityName??"any entity",h=l.context?` in ${l.context} context`:"",u=l.appliesTo?` (${l.appliesTo})`:"";return`${c}Entity is "${d}"${h}${u}`}case"FormStateRule":return`${c}Form state is "${l.state}"`;case"CommandClientTypeRule":return`${c}Client type is "${l.type}" (${$e(l.type)})`;case"CrmClientTypeRule":return`${c}CRM client type is "${l.type}"`;case"CustomRule":return`${c}Custom rule: ${l.functionName}() from ${l.library}`;case"OrRule":return`(${l.groups.map(h=>h.length===1?B(h[0]):`(${h.map(B).join(" AND ")})`).join(" OR ")})`;case"FeatureControlRule":return`${c}Feature "${l.featureControlBit}" is ${l.expectedValue?"on":"off"}`;case"RawRule":return`${l.tagName} (kept as XML)`;case"MiscellaneousPrivilegeRule":{const d=l.privilegeDepth?` at ${l.privilegeDepth} depth`:"";return`${c}User has "${l.privilegeName}" privilege${d}`}case"EntityPrivilegeRule":{const d=l.entityName?` on "${l.entityName}"`:"",h=l.appliesTo?` (${l.appliesTo})`:"";return`${c}User has ${l.privilegeType} privilege${d} at ${l.privilegeDepth} depth${h}`}case"EntityPropertyRule":{const d=l.entityName?` for "${l.entityName}"`:"";return`${c}Entity property "${l.propertyName}" is ${l.propertyValue}${d}`}case"FormTypeRule":return`${c}Form type is "${l.type}"`;case"FormEntityContextRule":return`${c}Form entity context is "${l.entityName}"`;case"ValueRule":return`${c}Field "${l.field}" equals "${l.value}"`;case"SkuRule":return`${c}SKU is "${l.sku}"`;case"HideForTabletExperienceRule":return`${c}Hide for tablet experience`;case"OrganizationSettingRule":return`${c}Organization setting "${l.setting}" is enabled`;case"PageRule":return`${c}Page address matches "${l.address}"`;case"RecordPrivilegeRule":{const d=l.appliesTo?` (${l.appliesTo})`:"";return`${c}User has ${l.privilegeType} privilege on current record${d}`}case"RelationshipTypeRule":{const d=l.relationshipType??"any";return`${c}Relationship type is "${d}" (${l.appliesTo})`}case"ReferencingAttributeRequiredRule":return`${c}Referencing attribute is required`;case"OutlookItemTrackingRule":return`${c}Outlook item is ${l.trackedInCrm?"":"not "}tracked in CRM`;case"OutlookRenderTypeRule":return`${c}Outlook render type is "${l.type}"`;case"OutlookVersionRule":return`${c}Outlook version is "${l.version}"`;case"CrmOfflineAccessStateRule":return`${c}CRM offline state is "${l.state}"`;case"CrmOutlookClientTypeRule":return`${c}CRM Outlook client type is "${l.type}"`;case"CrmOutlookClientVersionRule":return`${c}CRM Outlook client version is ${l.major}.${l.minor??0}+`;case"DeviceTypeRule":return`${c}Device type is "${l.type}"`;case"OptionSetRule":return`${c}Option set "${l.optionSet}" state code is "${l.stateCode}"`;default:return"Unknown rule step"}}function $e(l){switch(l){case"Modern":return"Unified Interface";case"Refresh":return"legacy updated web client";case"Legacy":return"Classic ribbon / Outlook list views";default:return l}}const Oe=L({drawer:{width:"560px",maxWidth:"90vw"},body:{display:"flex",flexDirection:"column",gap:s.spacingVerticalS,padding:s.spacingVerticalM,overflowY:"auto"},header:{display:"flex",alignItems:"center",gap:s.spacingHorizontalS},stepsList:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,listStyle:"none",padding:0,margin:0},summary:{padding:s.spacingVerticalS,backgroundColor:s.colorNeutralBackground3,borderRadius:s.borderRadiusMedium,fontStyle:"italic",color:s.colorNeutralForeground2,fontSize:s.fontSizeBase200},addRow:{display:"flex",gap:s.spacingHorizontalS},pickerPopover:{maxHeight:"60vh",overflowY:"auto",minWidth:"320px",padding:s.spacingVerticalM},usedBy:{color:s.colorNeutralForeground3,fontSize:s.fontSizeBase200},ruleIdRow:{display:"flex",alignItems:"flex-end",gap:s.spacingHorizontalS},ruleIdInput:{fontFamily:s.fontFamilyMonospace},error:{color:s.colorPaletteRedForeground1,fontSize:s.fontSizeBase100},sortableItem:{listStyle:"none"},sortableInner:{display:"flex",alignItems:"flex-start",gap:s.spacingHorizontalS},dragHandle:{marginTop:s.spacingVerticalS,cursor:"grab"}}),ke=[],Ve=()=>{const l=Oe(),c=P(i=>i.ruleEditorOpen),d=P(i=>i.ruleEditorId),h=P(i=>i.ruleEditorKind),u=P(i=>i.closeRuleEditor),E=P(i=>i.openRuleEditor),T=O(i=>i.enableRules),v=O(i=>i.displayRules),j=O(i=>i.commands),N=O(i=>i.upsertEnableRule),r=O(i=>i.upsertDisplayRule),$=O(i=>i.renameEnableRuleId),A=O(i=>i.renameDisplayRuleId),[a,n]=F.useState(!1),[g,R]=F.useState(""),x=h==="enable",o=x?T.find(i=>i.id===d):v.find(i=>i.id===d);F.useEffect(()=>{o&&R(o.id)},[o]);const b=me(`${h}:${o?.id??""}`,o?.steps??ke),C=b.keys,_=j.filter(i=>x?i.enableRules.includes(d??""):i.displayRules.includes(d??"")).length,I=(i,y)=>{if(!o)return;const S=[...o.steps];S[i]=y,b.update(),x?N({...o,steps:S}):r({...o,steps:S})},M=i=>{if(!o)return;const y=o.steps.filter((S,D)=>D!==i);b.remove(i),x?N({...o,steps:y}):r({...o,steps:y})},ee=i=>{if(!o)return;const y=[...o.steps,i];b.add(),x?N({...o,steps:y}):r({...o,steps:y}),n(!1)},le=i=>{if(!o||!i.over||i.active.id===i.over.id)return;const y=C.indexOf(String(i.active.id)),S=C.indexOf(String(i.over.id));if(y<0||S<0)return;const D=ge(o.steps,y,S);b.move(y,S),x?N({...o,steps:D}):r({...o,steps:D})};if(!o)return null;const ne=Ne(o.steps),ae=(x?T:v).some(i=>i.id===g.trim()&&i.id!==o.id),z=g.trim()?/\s/.test(g)?"Rule ID cannot contain whitespace.":ae?"A rule with this ID already exists.":"":"Rule ID is required.";return e.jsxs(se,{position:"end",open:c,onOpenChange:()=>u(),className:l.drawer,children:[e.jsx(oe,{children:e.jsx(ce,{action:e.jsx(k,{appearance:"subtle",icon:e.jsx(U,{}),onClick:u,"aria-label":"Close rule editor"}),children:e.jsxs("div",{className:l.header,children:[e.jsx(K,{appearance:"filled",color:x?"success":"informative",size:"small",children:x?"Enable":"Display"}),e.jsx(f,{size:400,weight:"semibold",style:{fontFamily:s.fontFamilyMonospace},children:o.id})]})})}),e.jsxs(ue,{className:l.body,children:[e.jsxs(f,{className:l.usedBy,children:["Used by ",_," command(s)"]}),e.jsxs("div",{className:l.ruleIdRow,children:[e.jsx(m,{className:l.ruleIdInput,value:g,onChange:(i,y)=>R(y.value),"aria-label":"Rule ID"}),e.jsx(k,{appearance:"secondary",size:"small",disabled:!g.trim()||!!z||g===o.id,onClick:()=>{const i=g.trim();(x?$(o.id,i):A(o.id,i))&&E(i,x?"enable":"display")},children:"Apply ID change"})]}),z&&e.jsx(f,{className:l.error,children:z}),x&&e.jsx(de,{intent:"warning",children:e.jsx(pe,{children:"Enable rules have a restricted set of allowed step types. Display-only rule kinds are disabled."})}),e.jsx(H,{children:"Steps (ALL must pass)"}),e.jsx(xe,{collisionDetection:ye,onDragEnd:le,children:e.jsx(ve,{items:C,strategy:je,children:e.jsxs("ol",{className:l.stepsList,role:"list","aria-label":"Rule steps",children:[o.steps.map((i,y)=>e.jsx(we,{id:C[y],styles:l,children:e.jsx(Z,{step:i,onChange:S=>I(y,S),onRemove:()=>M(y),container:x?"enable":"display"})},C[y])),o.steps.length===0&&e.jsx(f,{italic:!0,style:{color:s.colorNeutralForeground3},children:"No steps yet. A rule needs at least one step: add one before you publish, or remove the rule from its commands."})]})})}),e.jsxs(q,{open:a,onOpenChange:(i,y)=>n(y.open),children:[e.jsx(Q,{children:e.jsx(k,{icon:e.jsx(X,{}),appearance:"secondary",onClick:()=>n(!0),children:"Add step"})}),e.jsx(Y,{className:l.pickerPopover,children:e.jsx(J,{onSelect:ee,container:x?"enable":"display"})})]}),e.jsx(H,{children:"Plain-English summary"}),e.jsx("div",{className:l.summary,role:"note","aria-label":"Rule summary",children:ne})]})]})};function we({id:l,children:c,styles:d}){const{attributes:h,listeners:u,setNodeRef:E,setActivatorNodeRef:T,transform:v,transition:j}=Re({id:l});return e.jsx("li",{ref:E,className:d.sortableItem,style:{transform:be.Transform.toString(v),transition:j},children:e.jsxs("div",{className:d.sortableInner,children:[e.jsx(k,{ref:T,appearance:"subtle",size:"small",className:d.dragHandle,...h,...u,"aria-label":"Drag to reorder step",children:"Drag"}),e.jsx("div",{style:{flex:1},children:c})]})})}export{Ve as RuleEditorPanel,Ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as e,h as O,co as I,cq as C,z as $}from"./fluent-icons-BqJj6rDi.js";import{a as M,R as X}from"./monaco-BIO15LCS.js";import{a as k,ab as H,u as q}from"./index-Di2_5czx.js";import{ai as A,aj as P,ak as U,aa as G,d as c,al as Y,b as x,t as l,a7 as R,B,F as p,S as j,I as L}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const Z=$({drawer:{width:"600px",maxWidth:"95vw"},body:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalM,padding:l.spacingHorizontalM,overflowY:"auto"},stepRow:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalXS,padding:l.spacingHorizontalS,border:`1px solid ${l.colorNeutralStroke2}`,borderRadius:l.borderRadiusMedium,backgroundColor:l.colorNeutralBackground2},stepHeader:{display:"flex",alignItems:"center",gap:l.spacingHorizontalS},stepFields:{display:"flex",gap:l.spacingHorizontalS,flexWrap:"wrap",alignItems:"flex-end"},sectionLabel:{color:l.colorNeutralForeground3,textTransform:"uppercase",fontSize:l.fontSizeBase100,letterSpacing:"0.5px",fontWeight:l.fontWeightSemibold},warningNote:{backgroundColor:l.colorStatusWarningBackground1,borderRadius:l.borderRadiusMedium,padding:`${l.spacingHorizontalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase100}}),D=["Large","LargeLarge","LargeMedium","LargeSmall","MediumLarge","MediumMedium","MediumSmall","SmallMedium","SmallSmall","Popup"],ae=()=>{const o=Z(),b=k(a=>a.scalingEditorOpen),S=k(a=>a.closeScalingEditor),y=H(a=>a.location),u=H(a=>a.tabId),_=q(a=>a.ribbons),E=q(a=>a.setScaling),v=_[y],r=v.tabs.find(a=>a.id===u),h=u?v.scalingByTab?.[u]:void 0,[w,g]=M.useState([]),[N,m]=M.useState([]);X.useEffect(()=>{if(!(!b||!r)){if(h){g([...h.maxSizes]),m([...h.scales]);return}g([{id:`MaxSize.${r.id}.1`,groupId:r.groups[0]?.id??"",size:"Large",sequence:10}]),m([{id:`Scale.${r.id}.1`,groupId:r.groups[0]?.id??"",size:"SmallSmall",sequence:200}])}},[b,r,h]);const d=r?.groups??[],F=()=>{g(a=>[...a,{id:`MaxSize.${a.length+1}`,groupId:d[0]?.id??"",size:"Large",sequence:(a.length+1)*10}])},T=()=>{m(a=>[...a,{id:`Scale.${a.length+1}`,groupId:d[0]?.id??"",size:"SmallSmall",sequence:200+(a.length+1)*10}])},z=(a,i)=>{g(s=>s.map((n,t)=>t===a?{...n,...i}:n))},f=(a,i)=>{m(s=>s.map((n,t)=>t===a?{...n,...i}:n))},W=()=>{E(y,u,{tabId:u,maxSizes:w,scales:N}),S()};return e.jsxs(A,{className:o.drawer,open:b,position:"end",onOpenChange:(a,i)=>!i.open&&S(),children:[e.jsx(P,{children:e.jsx(U,{action:e.jsx(c,{appearance:"subtle",icon:e.jsx(O,{}),onClick:S,"aria-label":"Close"}),children:e.jsx(G,{children:"Scaling Editor"})})}),e.jsx(Y,{children:e.jsxs("div",{className:o.body,children:[e.jsxs("div",{className:o.warningNote,children:["⚠ ",e.jsx("strong",{children:"Scaling applies ONLY to the Classic ribbon"})," — forms NOT updated to Unified Interface, and Dynamics 365 for Outlook list views. The modern command bar (Unified Interface) ignores all MaxSize and Scale definitions entirely."]}),r&&e.jsxs(x,{size:200,style:{color:l.colorNeutralForeground3},children:["Tab: ",e.jsx("strong",{children:r.label})," (",r.id,")"]}),e.jsx(R,{}),e.jsxs("div",{children:[e.jsx(x,{className:o.sectionLabel,children:"MaxSize (largest size, shown first)"}),e.jsx(x,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingHorizontalS},children:"Sequence numbers must be lower than all Scale step sequence numbers."}),w.map((a,i)=>e.jsxs("div",{className:o.stepRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsxs("div",{className:o.stepHeader,children:[e.jsxs(B,{appearance:"tint",color:"brand",size:"small",children:["MaxSize ",i+1]}),e.jsx("div",{style:{flex:1}}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(I,{}),onClick:()=>g(s=>s.filter((n,t)=>t!==i))})]}),e.jsxs("div",{className:o.stepFields,children:[e.jsx(p,{label:"Group",style:{minWidth:"160px"},children:e.jsxs(j,{size:"small",value:a.groupId,onChange:(s,n)=>z(i,{groupId:n.value}),children:[d.length===0&&e.jsx("option",{value:"",children:"— no groups —"}),d.map(s=>e.jsx("option",{value:s.id,children:s.label||s.id},s.id))]})}),e.jsx(p,{label:"Size",style:{minWidth:"140px"},children:e.jsx(j,{size:"small",value:a.size,onChange:(s,n)=>z(i,{size:n.value}),children:D.map(s=>e.jsx("option",{value:s,children:s},s))})}),e.jsx(p,{label:"Sequence",style:{width:"80px"},children:e.jsx(L,{size:"small",type:"number",value:String(a.sequence),onChange:(s,n)=>z(i,{sequence:parseInt(n.value,10)||0})})})]})]},i)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(C,{}),onClick:F,children:"Add MaxSize"})]}),e.jsx(R,{}),e.jsxs("div",{children:[e.jsx(x,{className:o.sectionLabel,children:"Scale steps (collapse order — top-down)"}),e.jsx(x,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingHorizontalS},children:"Scale elements are applied in document order (top-down when shrinking, bottom-up when growing). Sequence numbers must be higher than all MaxSize sequence numbers."}),N.map((a,i)=>e.jsxs("div",{className:o.stepRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsxs("div",{className:o.stepHeader,children:[e.jsxs(B,{appearance:"tint",color:"informative",size:"small",children:["Scale ",i+1]}),e.jsx("div",{style:{flex:1}}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(I,{}),onClick:()=>m(s=>s.filter((n,t)=>t!==i))})]}),e.jsxs("div",{className:o.stepFields,children:[e.jsx(p,{label:"Group",style:{minWidth:"160px"},children:e.jsxs(j,{size:"small",value:a.groupId,onChange:(s,n)=>f(i,{groupId:n.value}),children:[d.length===0&&e.jsx("option",{value:"",children:"— no groups —"}),d.map(s=>e.jsx("option",{value:s.id,children:s.label||s.id},s.id))]})}),e.jsx(p,{label:"Size",style:{minWidth:"140px"},children:e.jsx(j,{size:"small",value:a.size,onChange:(s,n)=>f(i,{size:n.value}),children:D.map(s=>e.jsx("option",{value:s,children:s},s))})}),e.jsx(p,{label:"Sequence",style:{width:"80px"},children:e.jsx(L,{size:"small",type:"number",value:String(a.sequence),onChange:(s,n)=>f(i,{sequence:parseInt(n.value,10)||0})})})]})]},i)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(C,{}),onClick:T,children:"Add Scale step"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:l.spacingHorizontalS,paddingTop:l.spacingHorizontalS},children:[e.jsx(c,{appearance:"secondary",onClick:S,children:"Cancel"}),e.jsx(c,{appearance:"primary",onClick:W,children:"Save scaling"})]})]})})]})};export{ae as ScalingEditorPanel,ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as e,h as $,co as q,cq as L,z as U}from"./fluent-icons-BqJj6rDi.js";import{a as k,R as V}from"./monaco-BIO15LCS.js";import{a as D,ab as H,u as f,aC as X}from"./index-Di2_5czx.js";import{ai as Y,aj as J,ak as K,aa as Q,d as m,al as Z,M as R,f as w,b as c,t as s,B as ee,F as h,S,I as P}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";function A(r){return(r??[]).flatMap(b=>b.rules)}function E(){return{kind:"EntityRule",appliesTo:"PrimaryEntity",context:"HomePageGrid"}}function F(){return{kind:"PageRule",address:""}}const ae=U({drawer:{width:"560px",maxWidth:"95vw"},body:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalM,padding:s.spacingHorizontalM,overflowY:"auto"},ruleRow:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalXS,padding:s.spacingHorizontalS,border:`1px solid ${s.colorNeutralStroke2}`,borderRadius:s.borderRadiusMedium,backgroundColor:s.colorNeutralBackground2},ruleHeader:{display:"flex",alignItems:"center",gap:s.spacingHorizontalS},stepFields:{display:"flex",gap:s.spacingHorizontalS,alignItems:"flex-end",flexWrap:"wrap"}}),oe=()=>{const r=ae(),b=D(a=>a.tabDisplayRulesOpen),j=D(a=>a.closeTabDisplayRules),x=H(a=>a.location),g=H(a=>a.tabId),I=f(a=>a.ribbons),B=f(a=>a.setTabDisplayRules),z=I[x],i=z.tabs.find(a=>a.id===g),u=x==="Application",C=f(a=>!a.baseline[x]?.tabs.some(l=>l.id===g)),N=f(a=>X(a,x)),o=!!i&&!C&&N!==void 0&&!N.includes(g),[p,v]=k.useState(()=>A(i?.tabDisplayRules)),[T,y]=k.useState(null);V.useEffect(()=>{b&&(y(null),v(A(i?.tabDisplayRules)))},[b,i]);const d=(a,l)=>{v(t=>t.map((n,W)=>W===a?l:n))},M=()=>{v(a=>[...a,u?F():E()])},_=a=>{v(l=>l.filter((t,n)=>n!==a))},G=()=>{if(!i){y("No active tab selected.");return}for(const[a,l]of p.entries()){if(l.kind==="PageRule"&&!u){y(`Step ${a+1}: a page rule is only valid on application ribbon tabs.`);return}if(l.kind==="PageRule"&&!l.address.trim()){y(`Step ${a+1}: enter the page address.`);return}}y(null),B(x,g,p.length>0?[{tabCommand:i.commandId??"",rules:p}]:[]),j()},O=a=>[...new Set([z.entityLogicalName,a.entityName].filter(l=>!!l))];return e.jsxs(Y,{className:r.drawer,open:b,position:"end",onOpenChange:(a,l)=>!l.open&&j(),children:[e.jsx(J,{children:e.jsx(K,{action:e.jsx(m,{appearance:"subtle",icon:e.jsx($,{}),onClick:j,"aria-label":"Close"}),children:e.jsx(Q,{children:"Tab Display Rules"})})}),e.jsx(Z,{children:e.jsxs("div",{className:r.body,children:[T&&e.jsx(R,{intent:"error",children:e.jsx(w,{children:T})}),e.jsx(R,{intent:"info",children:e.jsx(w,{children:e.jsxs(c,{size:200,children:["Tabs are ",e.jsx("strong",{children:"hidden by default"}),". A tab's display rule says where it's shown, and is bound to the tab's Command."]})})}),i&&e.jsxs("div",{children:[e.jsxs(c,{size:200,style:{color:s.colorNeutralForeground3},children:["Tab: ",e.jsx("strong",{children:i.label})," (",i.id,")"]}),i.commandId&&e.jsxs(c,{size:200,style:{color:s.colorNeutralForeground3,display:"block"},children:["Command ID:"," ",e.jsx("code",{style:{fontFamily:s.fontFamilyMonospace},children:i.commandId})]})]}),o&&e.jsx(R,{intent:"warning",children:e.jsx(w,{children:e.jsx(c,{size:200,children:"This tab isn't added by your customizations, so its display rule can't be changed here."})})}),p.length===0&&e.jsx(c,{style:{color:s.colorNeutralForeground3,textAlign:"center"},children:o?"This tab has no display rule of its own.":C&&!u?"No steps: when you publish, this new tab gets the default rule for its location (this table, where the tab is).":"No steps: this tab will be hidden."}),p.length>0&&e.jsxs("div",{className:r.ruleRow,children:[e.jsxs("div",{className:r.ruleHeader,children:[e.jsx(ee,{appearance:"outline",size:"small",children:"Display rule"}),e.jsx(c,{size:200,style:{color:s.colorNeutralForeground3},children:"The tab shows where any step matches."})]}),p.map((a,l)=>e.jsxs("div",{className:r.stepFields,children:[e.jsx(h,{label:"Type",style:{minWidth:"140px"},children:e.jsxs(S,{size:"small",value:a.kind,disabled:o,onChange:(t,n)=>{n.value==="PageRule"?d(l,F()):d(l,E())},children:[e.jsx("option",{value:"EntityRule",children:"Entity Rule"}),u&&e.jsx("option",{value:"PageRule",children:"Page Rule"})]})}),a.kind==="EntityRule"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"Applies to",style:{minWidth:"130px"},children:e.jsxs(S,{size:"small",value:a.appliesTo??"",disabled:o,onChange:(t,n)=>d(l,{...a,appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"Primary entity"}),e.jsx("option",{value:"SelectedEntity",children:"Selected entity"})]})}),e.jsx(h,{label:"Context",style:{minWidth:"160px"},children:e.jsxs(S,{size:"small",value:a.context??"",disabled:o,onChange:(t,n)=>d(l,{...a,context:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"Form",children:"Form"}),e.jsx("option",{value:"HomePageGrid",children:"Home Page Grid"}),e.jsx("option",{value:"SubGridStandard",children:"SubGrid Standard"}),e.jsx("option",{value:"SubGridAssociated",children:"SubGrid Associated"})]})}),u?e.jsx(h,{label:"Table (optional)",children:e.jsx(P,{size:"small",value:a.entityName??"",disabled:o,onChange:(t,n)=>d(l,{...a,entityName:n.value||void 0}),placeholder:"any"})}):e.jsx(h,{label:"Table",children:e.jsxs(S,{size:"small",value:a.entityName??"",disabled:o,onChange:(t,n)=>d(l,{...a,entityName:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),O(a).map(t=>e.jsx("option",{value:t,children:t},t))]})})]}),a.kind==="PageRule"&&e.jsx(h,{label:"Address pattern",style:{flex:1},children:e.jsx(P,{size:"small",value:a.address,disabled:o,onChange:(t,n)=>d(l,{...a,address:n.value}),placeholder:"https://…"})}),e.jsx(m,{appearance:"subtle",size:"small",icon:e.jsx(q,{}),disabled:o,onClick:()=>_(l),"aria-label":"Remove step"})]},l))]}),e.jsx(m,{appearance:"subtle",icon:e.jsx(L,{}),onClick:M,disabled:o||!i,children:"Add step"}),e.jsx(c,{size:100,style:{color:s.colorNeutralForeground3},children:u?"Entity rules and page rules are both valid on application ribbon tabs.":"A table's tabs take entity rules only."}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:s.spacingHorizontalS,paddingTop:s.spacingHorizontalS},children:[e.jsx(m,{appearance:"secondary",onClick:j,children:"Cancel"}),e.jsx(m,{appearance:"primary",onClick:G,disabled:o,children:"Save rules"})]})]})})]})};export{oe as TabDisplayRulesPanel,oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as e,h as D,co as M,cq as L,z as $}from"./fluent-icons-BqJj6rDi.js";import{a as n,R as A}from"./monaco-BIO15LCS.js";import{a as k}from"./index-Di2_5czx.js";import{D as F,i as I,k as _,j as X,aa as T,d as c,l as H,F as u,I as j,a1 as O,b as i,t as l,S as V,m as E}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const q=$({surface:{width:"720px",maxWidth:"95vw",maxHeight:"84vh",height:"84vh"},body:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalM,overflowY:"auto"},paramRow:{display:"flex",alignItems:"flex-end",gap:l.spacingHorizontalS},urlPreview:{fontFamily:l.fontFamilyMonospace,fontSize:l.fontSizeBase200,backgroundColor:l.colorNeutralBackground3,padding:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,borderRadius:l.borderRadiusMedium,wordBreak:"break-all",border:`1px solid ${l.colorNeutralStroke2}`},passParamsTable:{display:"grid",gridTemplateColumns:"120px 1fr",gap:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase200},warnNote:{backgroundColor:l.colorStatusWarningBackground1,borderRadius:l.borderRadiusMedium,padding:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase100}}),f=[{key:"typename",desc:"Logical name of the table"},{key:"type",desc:"Entity type code (integer — may vary between orgs)"},{key:"id",desc:"GUID of the primary record"},{key:"orgname",desc:"Unique organization name"},{key:"userlcid",desc:"User's language LCID"},{key:"orglcid",desc:"Organization's base language LCID"}],W=[{label:"New tab (Navigate)",value:"0"},{label:"Dialog",value:"1"},{label:"Popup",value:"2"}],Z=()=>{const r=q(),S=k(a=>a.urlComposerOpen),d=k(a=>a.closeUrlComposer),[t,z]=n.useState("https://"),[m,C]=n.useState(!1),[w,R]=n.useState("0"),[h,g]=n.useState([]),x=n.useMemo(()=>{const a=[...h].filter(s=>s.key.trim()).map(s=>`${encodeURIComponent(s.key)}={${s.value||s.key}}`);return m&&f.forEach(s=>{a.push(`${s.key}={${s.key}}`)}),a.length>0?`${t}?${a.join("&")}`:t},[t,m,h]),U=n.useMemo(()=>x.replace(/&/g,"&"),[x]),N=()=>{g(a=>[...a,{key:"",value:""}])},P=a=>{g(s=>s.filter((p,o)=>o!==a))},b=(a,s,p)=>{g(o=>o.map((v,B)=>B===a?{...v,[s]:p}:v))},y=t.startsWith("https://");return e.jsx(F,{open:S,onOpenChange:(a,s)=>!s.open&&d(),children:e.jsx(I,{className:r.surface,children:e.jsxs(_,{style:{height:"100%"},children:[e.jsx(X,{action:e.jsx(c,{appearance:"subtle",icon:e.jsx(D,{}),onClick:d,"aria-label":"Close"}),children:e.jsx(T,{children:"URL Action Composer"})}),e.jsxs(H,{className:r.body,children:[e.jsx(u,{label:"Base URL",required:!0,validationState:y?"none":"error",validationMessage:y?void 0:"URL must start with https://",children:e.jsx(j,{value:t,onChange:(a,s)=>z(s.value),placeholder:"https://contoso.com/page"})}),e.jsxs("div",{className:r.warnNote,children:["⚠ Ampersands in URLs must be escaped as ",e.jsx("code",{children:"&"})," in XML. CBS handles this automatically when generating XML."]}),e.jsx(O,{label:"PassParams — append standard record context parameters",checked:m,onChange:(a,s)=>C(s.checked)}),m&&e.jsxs("div",{children:[e.jsx(i,{size:200,weight:"semibold",children:"Standard PassParams:"}),e.jsx("div",{className:r.passParamsTable,children:f.map(a=>e.jsxs(A.Fragment,{children:[e.jsx("code",{style:{fontFamily:l.fontFamilyMonospace,fontSize:l.fontSizeBase200},children:a.key}),e.jsx(i,{size:100,style:{color:l.colorNeutralForeground3},children:a.desc})]},a.key))}),e.jsxs(i,{size:100,style:{color:l.colorStatusWarningForeground1,marginTop:l.spacingVerticalXS,display:"block"},children:["Note: Use ",e.jsx("code",{children:"typename"})," instead of ",e.jsx("code",{children:"type"})," for reliability — type codes can differ between environments."]})]}),e.jsxs("div",{children:[e.jsx(i,{weight:"semibold",size:200,children:"Custom query parameters"}),e.jsxs(i,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingVerticalXS},children:["Each parameter becomes a querystring key=value pair. Use CRM tokens like"," ",e.jsx("code",{children:"{id}"}),"."]}),h.map((a,s)=>e.jsxs("div",{className:r.paramRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsx(u,{label:"Key",style:{flex:1},children:e.jsx(j,{size:"small",value:a.key,onChange:(p,o)=>b(s,"key",o.value),placeholder:"paramName"})}),e.jsx(u,{label:"Value / token",style:{flex:1},children:e.jsx(j,{size:"small",value:a.value,onChange:(p,o)=>b(s,"value",o.value),placeholder:"static value or {id}"})}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(M,{}),onClick:()=>P(s),"aria-label":"Remove parameter",style:{marginBottom:"4px"}})]},s)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(L,{}),onClick:N,children:"Add parameter"})]}),e.jsx(u,{label:"Open in",children:e.jsx(V,{value:w,onChange:(a,s)=>R(s.value),children:W.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})}),e.jsxs("div",{children:[e.jsx(i,{size:200,weight:"semibold",style:{display:"block",marginBottom:"4px"},children:"URL preview (tokens shown literally):"}),e.jsx("div",{className:r.urlPreview,children:x})]}),e.jsxs("div",{children:[e.jsxs(i,{size:200,weight:"semibold",style:{display:"block",marginBottom:"4px"},children:["XML-encoded URL (",e.jsx("code",{children:"&"})," → ",e.jsx("code",{children:"&"}),"):"]}),e.jsx("div",{className:r.urlPreview,children:U})]})]}),e.jsxs(E,{children:[e.jsx(c,{appearance:"secondary",onClick:d,children:"Cancel"}),e.jsx(c,{appearance:"primary",disabled:!y,onClick:d,children:"Apply URL"})]})]})})})};export{Z as UrlComposerModal,Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as s,h as se,E as le,ba as ae,z as oe,bm as D,c_ as S,L as b}from"./fluent-icons-BqJj6rDi.js";import{a as T,Z as re,l as U,aD as ne,aE as te,aF as _,aG as ie,w as z,E as ce,j as de,ax as ue,P as ge,k as xe}from"./index-Di2_5czx.js";import{a as t}from"./monaco-BIO15LCS.js";import{u as pe}from"./useReplaceWebResourceConfirm-BUWBVNSC.js";import{a0 as B,D as he,i as me,k as fe,j as je,aa as Se,d as y,l as be,I as ye,S as we,an as ve,M as G,f as P,b as i,t as a,a2 as Ce,a3 as Re,m as ke}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const Ne=oe({surface:{width:"780px",maxWidth:"95vw",height:"80vh",maxHeight:"80vh"},body:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",gap:a.spacingHorizontalS},toolbar:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,flexShrink:0},grid:{flex:1,overflow:"hidden"},gridWrap:{height:"100%"},gridRow:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,padding:`${a.spacingVerticalXS} ${a.spacingHorizontalS}`,cursor:"pointer",borderRadius:a.borderRadiusMedium,":hover":{backgroundColor:a.colorNeutralBackground3}},gridRowSelected:{backgroundColor:a.colorBrandBackground2},gridHeader:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,padding:`${a.spacingVerticalXS} ${a.spacingHorizontalS}`,borderBottom:`1px solid ${a.colorNeutralStroke2}`,flexShrink:0},col1:{width:"24px",flexShrink:0},col2:{width:"32px",flexShrink:0},col3:{flex:1,overflow:"hidden"},col4:{width:"60px",flexShrink:0,textAlign:"right"},col5:{width:"100px",flexShrink:0,color:a.colorNeutralForeground3},nameCell:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},descCell:{fontSize:a.fontSizeBase100,color:a.colorNeutralForeground3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),ze={js:s.jsx(b,{}),ts:s.jsx(b,{}),css:s.jsx(b,{}),html:s.jsx(b,{}),svg:s.jsx(S,{}),png:s.jsx(S,{}),gif:s.jsx(S,{}),jpg:s.jsx(S,{}),xml:s.jsx(D,{}),resx:s.jsx(D,{})};function w(x){return x.split(".").pop()?.toLowerCase()??""}const Be=[{label:"All types",value:"all"},{label:".js",value:"js"},{label:".html",value:"html"},{label:".svg",value:"svg"},{label:".png",value:"png"},{label:".css",value:"css"},{label:".xml",value:"xml"},{label:".resx",value:"resx"}],Me=({onSelect:x})=>{const n=Ne(),E=pe(),v=T(e=>e.webResourceBrowserOpen),u=T(e=>e.closeWebResourceBrowser),A=re(e=>e.publisherPrefix),F=t.useRef(null),[I,W]=t.useState([]),[C,p]=t.useState(!1),[H,M]=t.useState(!1),[$,g]=t.useState(null),[O,R]=t.useState(null),[k,X]=t.useState(""),[h,V]=t.useState("all"),[N,Y]=t.useState(!0),[m,L]=t.useState(null),f=t.useMemo(()=>{const e=k.toLowerCase();return I.filter(l=>{const o=w(l.name),r=e===""||l.name.toLowerCase().includes(e)||(l.description??"").toLowerCase().includes(e),c=h==="all"||o===h,j=!N||l.isCustom;return r&&c&&j})},[I,k,h,N]),d=f.find(e=>e.id===m)??null,q=[B({columnId:"type",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Type"}),renderCell:e=>{const l=w(e.name),o=ze[l]??s.jsx(D,{});return s.jsx("div",{className:n.col2,style:{color:a.colorNeutralForeground3},children:o})}}),B({columnId:"name",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Name"}),renderCell:e=>s.jsxs("div",{className:n.col3,children:[s.jsx("div",{className:n.nameCell,children:s.jsx(i,{style:{fontFamily:a.fontFamilyMonospace,fontSize:a.fontSizeBase200},children:e.name})}),e.description&&s.jsx("div",{className:n.descCell,children:e.description})]})}),B({columnId:"modified",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Modified"}),renderCell:e=>s.jsx("div",{className:n.col5,children:s.jsx(i,{size:100,children:e.modifiedOn?new Date(e.modifiedOn).toLocaleDateString():"—"})})})];t.useEffect(()=>{v&&(p(!0),g(null),R(null),U().then(e=>W(e)).catch(e=>g(e instanceof Error?e.message:String(e))).finally(()=>p(!1)))},[v]);const Z=async()=>{p(!0),g(null);try{W(await U())}catch(e){g(e instanceof Error?e.message:String(e))}finally{p(!1)}},J=e=>new Promise((l,o)=>{const r=new FileReader;r.onerror=()=>o(r.error??new Error("Unable to read file")),r.onload=()=>{const c=String(r.result??"");l(c.includes(",")?c.split(",")[1]??"":c)},r.readAsDataURL(e)}),K=e=>{const l=w(e.name);return`${A||"new"}_/${l==="js"||l==="css"||l==="html"||l==="xml"?"scripts":l==="svg"||l==="png"?"icons":"webresources"}/${e.name}`},Q=async e=>{const l=xe();M(!0),R(null);try{const o=await J(e),r=w(e.name),c={html:1,css:2,js:3,xml:4,png:5,jpg:6,gif:7,xsl:9,ico:10,svg:11,resx:12}[r]??4,j=await de(K(e),o,c,{displayName:e.name,guard:l,onExisting:E.onExisting});await Z(),R([j.solutionWarning,j.publishWarning].filter(Boolean).join(" ")||null)}catch(o){if(o instanceof ue)return;const r=o instanceof Error?o.message:String(o);g(r),ge.getState().logError("webresource",`Upload of ${e.name} failed: ${r}`)}finally{M(!1)}},ee=()=>{d&&(z.invoke(d),x?.(d),u())};return s.jsxs(s.Fragment,{children:[E.dialog,s.jsx(he,{open:v,onOpenChange:(e,l)=>{l.open||(z.clear(),u())},children:s.jsx(me,{className:n.surface,children:s.jsxs(fe,{style:{height:"100%"},children:[s.jsx(je,{action:s.jsx(y,{appearance:"subtle",icon:s.jsx(se,{}),onClick:u,"aria-label":"Close"}),children:s.jsx(Se,{children:"Web Resource Browser"})}),s.jsxs(be,{className:n.body,children:[s.jsx("input",{ref:F,type:"file",accept:".js,.html,.svg,.png,.css,.xml,.resx,.jpg,.gif,.ico,.xsl",style:{display:"none"},onChange:e=>{const l=e.target.files?.[0];e.currentTarget.value="",l&&Q(l)}}),s.jsxs("div",{className:n.toolbar,children:[s.jsx(ye,{contentBefore:s.jsx(le,{}),placeholder:"Search by name…",value:k,onChange:(e,l)=>X(l.value),size:"small",style:{flex:1}}),s.jsx(we,{size:"small",value:h,onChange:(e,l)=>V(l.value),style:{width:"100px"},children:Be.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(ve,{label:"Custom only",checked:N,onChange:(e,l)=>Y(l.checked===!0)})]}),$&&s.jsx(G,{intent:"error",children:s.jsx(P,{children:$})}),O&&s.jsx(G,{intent:"warning",children:s.jsx(P,{children:O})}),s.jsxs("div",{className:n.grid,children:[C&&s.jsx(i,{style:{color:a.colorNeutralForeground3,padding:a.spacingHorizontalM},children:"Loading web resources…"}),!C&&f.length===0&&s.jsx(i,{style:{color:a.colorNeutralForeground3,padding:a.spacingHorizontalM,textAlign:"center"},children:"No web resources found."}),!C&&f.length>0&&s.jsxs(ne,{className:n.gridWrap,items:f,columns:q,getRowId:e=>e.id,focusMode:"composite",selectionMode:"single",subtleSelection:!0,selectedItems:m?new Set([m]):new Set,onSelectionChange:(e,l)=>{const o=[...l.selectedItems][0];L(o??null)},children:[s.jsx(te,{children:s.jsx(_,{children:({renderHeaderCell:e})=>s.jsx(Ce,{children:e()})})}),s.jsx(ie,{itemSize:56,height:360,listProps:{width:"100%"},children:({item:e,rowId:l},o)=>s.jsx(_,{style:o,className:`${n.gridRow} ${e.id===m?n.gridRowSelected:""}`,onDoubleClick:()=>{L(e.id),z.invoke(e),x?.(e),u()},children:({renderCell:r})=>s.jsx(Re,{children:r(e)})},l)})]})]}),d&&s.jsx("div",{style:{padding:a.spacingHorizontalXS,backgroundColor:a.colorNeutralBackground3,borderRadius:a.borderRadiusMedium,flexShrink:0},children:s.jsxs(i,{size:200,style:{fontFamily:a.fontFamilyMonospace},children:["$webresource:",d.name]})})]}),s.jsxs(ke,{fluid:!0,children:[s.jsx(y,{appearance:"subtle",icon:s.jsx(ae,{}),disabled:H,onClick:()=>F.current?.click(),children:H?"Uploading…":"Upload"}),s.jsx(ce,{prefix:"Uploads to"}),s.jsx("div",{style:{flex:1}}),s.jsx(y,{appearance:"secondary",onClick:u,children:"Cancel"}),s.jsx(y,{appearance:"primary",disabled:!d,onClick:ee,children:"Select"})]})]})})})]})};export{Me as WebResourceBrowser,Me as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y as t,X as H,h as O,ci as V,bc as z,d5 as G,ba as U,z as W}from"./fluent-icons-BqJj6rDi.js";import{a as s}from"./monaco-BIO15LCS.js";import{u as h,a as v,l as _,g as K,c as Q,s as Z}from"./index-Di2_5czx.js";import{M as q}from"./MonacoEditor-uzfuRCpJ.js";import{ai as J,aj as Y,ak as ee,t as d,d as ne,al as te,M as j,f as $,ac as re,ad as ae,am as y}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const oe=["Add","AddCircle","Alert","AppFolder","Archive","ArrowClockwise","ArrowCounterclockwise","ArrowDown","ArrowExport","ArrowImport","ArrowLeft","ArrowRight","ArrowSync","ArrowUp","Attach","Beaker","Bookmark","Bug","Building","Calculator","CalendarLtr","CalendarMonth","Call","Camera","Cart","Chart","Checkmark","CheckmarkCircle","Circle","ClipboardTask","Clock","Cloud","Code","CodeBlock","Comment","ContactCard","Copy","CreditCard","Crown","Cube","CursorClick","DataBarVertical","Delete","Diamond","Document","DocumentCopy","DocumentEdit","DocumentText","Download","Edit","Emoji","ErrorCircle","Eye","EyeOff","Filter","Flag","Flow","FolderOpen","Globe","Grid","Group","Heart","Home","Image","Info","Key","Library","Link","List","Location","Lock","Mail","Map","MegaphoneLoud","Money","MoreCircle","MoreHorizontal","Note","NoteEdit","NumberCircle1","Open","Organization","Pause","People","PeopleCommunity","Person","PersonAdd","PersonSearch","Phone","Play","Plug","Print","Question","Refresh","Rename","Save","Search","Send","Settings","Share","Shield","ShoppingBag","Sparkle","Star","StarEmphasis","Stop","Table","Tag","TaskList","TextBulletList","TextDescription","ThumbLike","Timer","ToggleLeft","ToggleRight","Tool","Translate","Umbrella","Unlock","Upload","Video","Warning","Wrench"];function A(r,g){const b=[];return b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:[":","$"],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!a.includes("$LocLabels:"))return{suggestions:[]};const C=a.lastIndexOf("$LocLabels:")+11,c=a.slice(C),u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:h.getState().locLabels.map(m=>({label:m.id,kind:r.languages.CompletionItemKind.Reference,insertText:m.id,range:u,detail:"LocLabel reference"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:[":","$"],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!a.includes("$webresource:"))return{suggestions:[]};const C=a.lastIndexOf("$webresource:")+13,c=a.slice(C),u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:g().map(m=>({label:m,kind:r.languages.CompletionItemKind.File,insertText:m,range:u,detail:"Web resource"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:['"'],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!/Command\s*=\s*"[^"]*$/.test(a))return{suggestions:[]};const c=a.match(/Command\s*=\s*"([^"]*)$/)?.[1]??"",u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:h.getState().commands.map(m=>({label:m.id,kind:r.languages.CompletionItemKind.Function,insertText:m.id,range:u,detail:"CommandDefinition"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:['"'],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!/ModernImage\s*=\s*"[^"]*$/.test(a))return{suggestions:[]};const c=a.match(/ModernImage\s*=\s*"([^"]*)$/)?.[1]??"",u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:oe.map(i=>({label:i,kind:r.languages.CompletionItemKind.Color,insertText:i,range:u,detail:"Fluent icon (ModernImage)",documentation:`Renders the ${i}_20_Regular Fluent icon`}))}}})),b}function I(r){r.forEach(g=>g.dispose())}const se=W({drawer:{width:"960px",maxWidth:"90vw"},body:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",padding:0},infoBar:{flexShrink:0,margin:`${d.spacingVerticalS} ${d.spacingHorizontalM}`},tabRow:{flexShrink:0,padding:`0 ${d.spacingHorizontalM}`},toolbar:{flexShrink:0,display:"flex",alignItems:"center",gap:d.spacingHorizontalS,padding:`${d.spacingVerticalXS} ${d.spacingHorizontalM}`,borderTop:`1px solid ${d.colorNeutralStroke2}`,borderBottom:`1px solid ${d.colorNeutralStroke2}`},editorContainer:{flex:1,minHeight:0,overflow:"hidden"}}),le=[{label:"Home Grid",value:"HomepageGrid"},{label:"Sub Grid",value:"SubGrid"},{label:"Form",value:"Form"},{label:"Application",value:"Application"}],Ce=()=>{const r=se(),g=v(e=>e.xmlDrawerOpen),b=v(e=>e.closeXmlDrawer),l=h(e=>e.ribbons),n=h(e=>e.baseline),a=h(e=>e.commands),C=h(e=>e.displayRules),c=h(e=>e.enableRules),u=h(e=>e.locLabels),N=v(e=>e.openImportXml),[i,m]=s.useState("HomepageGrid"),[S,p]=s.useState(null),[E,T]=s.useState(!1),f=s.useRef(0);s.useEffect(()=>{f.current++,p(null)},[i,g]);const[w,D]=s.useState([]),M=s.useRef(null),R=s.useRef(null),x=s.useRef([]);s.useEffect(()=>{g&&_().then(e=>D(e.map(o=>o.name))).catch(()=>D([]))},[g]),s.useEffect(()=>()=>{I(x.current),x.current=[]},[]);const X=s.useCallback((e,o)=>{M.current=e,R.current=o,I(x.current),x.current=A(o,()=>w)},[w]);s.useEffect(()=>{R.current&&(I(x.current),x.current=A(R.current,()=>w))},[w]);const B=()=>{M.current?.getAction("editor.action.formatDocument")?.run()},k=s.useCallback(e=>{try{return`<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
${K({location:e,current:l[e],baseline:n[e],commands:a,displayRules:C,enableRules:c,locLabels:u,entityLogicalName:l[e].entityLogicalName})}`}catch(o){return`<!-- Error generating XML: ${String(o)} -->`}},[l,n,a,C,c,u])(i);s.useEffect(()=>{f.current++,p(null)},[k]);const F=async()=>{const e=f.current,o=await Q(k);e===f.current&&p(o.ok?{intent:"success",text:"Copied the XML to the clipboard."}:{intent:"error",text:`Couldn't copy (${o.error}). Click in the XML, press Ctrl+A, then Ctrl+C.`})},P=async()=>{const e=f.current,o=`RibbonDiffXml_${i}.xml`;T(!0),p(null);try{const L=await Z(o,k,[{name:"XML",extensions:["xml"]}]);if(e!==f.current)return;L.ok&&L.path?p({intent:"success",text:`Saved to ${L.path}.`}):L.ok?p({intent:"success",text:`Started downloading ${o}. If no file appears, use Copy.`}):L.canceled?p(null):p({intent:"error",text:`Couldn't save the file (${L.error}). Use Copy instead.`})}finally{T(!1)}};return t.jsxs(J,{position:"end",open:g,onOpenChange:()=>b(),className:r.drawer,children:[t.jsx(Y,{children:t.jsxs(ee,{action:t.jsx(ne,{appearance:"subtle",icon:t.jsx(O,{}),onClick:b,"aria-label":"Close XML drawer"}),children:[t.jsx(H,{style:{marginRight:d.spacingHorizontalS}}),"RibbonDiffXml"]})}),t.jsxs(te,{className:r.body,children:[t.jsx(j,{className:r.infoBar,intent:"info",children:t.jsxs($,{children:["This is the ",t.jsx("strong",{children:"RibbonDiffXml"})," that will be packaged into your solution ZIP and imported into Dataverse. It contains only the delta (your changes), not the full ribbon."]})}),t.jsx("div",{className:r.tabRow,children:t.jsx(re,{selectedValue:i,onTabSelect:(e,o)=>m(o.value),children:le.map(e=>t.jsx(ae,{value:e.value,children:e.label},e.value))})}),t.jsxs("div",{className:r.toolbar,children:[t.jsx(y,{icon:t.jsx(V,{}),onClick:()=>{F()},children:"Copy"}),t.jsx(y,{icon:t.jsx(z,{}),disabled:E,onClick:()=>{P()},children:"Download"}),t.jsx(y,{icon:t.jsx(G,{}),onClick:B,children:"Format XML"}),t.jsx(y,{icon:t.jsx(U,{}),onClick:()=>N(k),children:"Import this XML"})]}),S&&t.jsx(j,{intent:S.intent,className:r.infoBar,role:"status",children:t.jsx($,{children:S.text})}),t.jsx("div",{className:r.editorContainer,children:t.jsx(q,{language:"xml",value:k,readOnly:!0,height:"100%",onMount:X})})]})]})};export{Ce as XmlDrawer,Ce as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as l,R as O}from"./monaco-BIO15LCS.js";import{r as Ne}from"./fluent-ui-QADO660t.js";function En(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const rt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function z(e){var t,n;return e?we(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=z(e);return e instanceof t}function Be(e){return we(e)?!1:e instanceof z(e).HTMLElement}function Wt(e){return e instanceof z(e).SVGElement}function xe(e){return e?we(e)?e.document:mt(e)?yt(e)?e:Be(e)||Wt(e)?e.ownerDocument:document:document:document}const V=rt?l.useLayoutEffect:l.useEffect;function ot(e){const t=l.useRef(e);return V(()=>{t.current=e}),l.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function An(){const e=l.useRef(null),t=l.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return V(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=l.useRef();return l.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function _e(e){const t=ot(e),n=l.useRef(null),r=l.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let dt={};function $e(e,t){return l.useMemo(()=>{if(t)return t;const n=dt[e]==null?0:dt[e]+1;return dt[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const ye=Ht(1),Ze=Ht(-1);function Mn(e){return"clientX"in e&&"clientY"in e}function it(e){if(!e)return!1;const{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function In(e){if(!e)return!1;const{TouchEvent:t}=z(e.target);return t&&e instanceof t}function et(e){if(In(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Mn(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function On(e){return e.matches(Tt)?e:e.querySelector(Tt)}const Nn={display:"none"};function Tn(e){let{id:t,value:n}=e;return O.createElement("div",{id:t,style:Nn},n)}function Ln(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return O.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function kn(){const[e,t]=l.useState("");return{announce:l.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vt=l.createContext(null);function Pn(e){const t=l.useContext(Vt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zn(){const[e]=l.useState(()=>new Set),t=l.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[l.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Bn={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},Fn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $n(e){let{announcements:t=Fn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Bn}=e;const{announce:i,announcement:s}=kn(),a=$e("DndLiveRegion"),[c,u]=l.useState(!1);if(l.useEffect(()=>{u(!0)},[]),Pn(l.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;i(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;i(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const d=O.createElement(O.Fragment,null,O.createElement(Tn,{id:r,value:o.draggable}),O.createElement(Ln,{id:a,announcement:s}));return n?Ne.createPortal(d,n):d}var T;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(T||(T={}));function tt(){}function bo(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const q=Object.freeze({x:0,y:0});function Xn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yn(e,t){const n=et(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Kn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Un(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Lt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const yo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Lt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=Xn(Lt(c),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(jn)};function Wn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,d=s*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const Hn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const c=Wn(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(Kn)};function Vn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function qt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:q}function qn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const Gn=qn(1);function Gt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Jn(e,t,n){const r=Gt(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const _n={ignoreTransform:!1};function De(e,t){t===void 0&&(t=_n);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=z(e).getComputedStyle(e);u&&(n=Jn(n,u,d))}const{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function kt(e){return De(e,{ignoreTransform:!0})}function Qn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Zn(e,t){return t===void 0&&(t=z(e).getComputedStyle(e)),t.position==="fixed"}function er(e,t){t===void 0&&(t=z(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function wt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||Wt(o)||n.includes(o))return n;const i=z(e).getComputedStyle(o);return o!==e&&er(o,i)&&n.push(o),Zn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Jt(e){const[t]=wt(e,1);return t??null}function ft(e){return!rt||!e?null:we(e)?e:mt(e)?yt(e)||e===xe(e).scrollingElement?window:Be(e)?e:null:null}function _t(e){return we(e)?e.scrollX:e.scrollLeft}function Qt(e){return we(e)?e.scrollY:e.scrollTop}function vt(e){return{x:_t(e),y:Qt(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function Zt(e){return!rt||!e?!1:e===document.scrollingElement}function en(e){const t={x:0,y:0},n=Zt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const tr={x:.2,y:.2};function nr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=tr);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=en(e),g={x:0,y:0},D={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=L.Backward,D.y=r*Math.abs((t.top+v.height-i)/v.height)):!d&&c>=t.bottom-v.height&&(g.y=L.Forward,D.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!h&&a>=t.right-v.width?(g.x=L.Forward,D.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(g.x=L.Backward,D.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:D}}function rr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function tn(e){return e.reduce((t,n)=>ye(t,vt(n)),q)}function or(e){return e.reduce((t,n)=>t+_t(n),0)}function ir(e){return e.reduce((t,n)=>t+Qt(n),0)}function nn(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Jt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sr=[["x",["left","right"],or],["y",["top","bottom"],ir]];class xt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=wt(n),o=tn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of sr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=a(r),d=o[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Te{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function ar(e){const{EventTarget:t}=z(e);return e instanceof t?e:xe(e)}function gt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var U;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(U||(U={}));function Pt(e){e.preventDefault()}function lr(e){e.stopPropagation()}var S;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(S||(S={}));const rn={start:[S.Space,S.Enter],cancel:[S.Esc],end:[S.Space,S.Enter,S.Tab]},cr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case S.Right:return{...n,x:n.x+25};case S.Left:return{...n,x:n.x-25};case S.Down:return{...n,y:n.y+25};case S.Up:return{...n,y:n.y-25}}};class on{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Te(xe(n)),this.windowListeners=new Te(z(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(U.Resize,this.handleCancel),this.windowListeners.add(U.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(U.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&nn(r),n(q)}handleKeyDown(t){if(it(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=rn,coordinateGetter:s=cr,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:q;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=Ze(f,d),g={x:0,y:0},{scrollableAncestors:D}=r.current;for(const v of D){const p=t.code,{isTop:b,isRight:y,isLeft:m,isBottom:R,maxScroll:C,minScroll:E}=en(v),w=rr(v),x={x:Math.min(p===S.Right?w.right-w.width/2:w.right,Math.max(p===S.Right?w.left:w.left+w.width/2,f.x)),y:Math.min(p===S.Down?w.bottom-w.height/2:w.bottom,Math.max(p===S.Down?w.top:w.top+w.height/2,f.y))},I=p===S.Right&&!y||p===S.Left&&!m,N=p===S.Down&&!R||p===S.Up&&!b;if(I&&x.x!==f.x){const M=v.scrollLeft+h.x,W=p===S.Right&&M<=C.x||p===S.Left&&M>=E.x;if(W&&!h.y){v.scrollTo({left:M,behavior:a});return}W?g.x=v.scrollLeft-M:g.x=p===S.Right?v.scrollLeft-C.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(N&&x.y!==f.y){const M=v.scrollTop+h.y,W=p===S.Down&&M<=C.y||p===S.Up&&M>=E.y;if(W&&!h.x){v.scrollTo({top:M,behavior:a});return}W?g.y=v.scrollTop-M:g.y=p===S.Down?v.scrollTop-C.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,ye(Ze(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}on.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=rn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function zt(e){return!!(e&&"distance"in e)}function Bt(e){return!!(e&&"delay"in e)}class Dt{constructor(t,n,r){var o;r===void 0&&(r=ar(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=xe(s),this.documentListeners=new Te(this.document),this.listeners=new Te(r),this.windowListeners=new Te(z(s)),this.initialCoordinates=(o=et(i))!=null?o:q,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(U.Resize,this.handleCancel),this.windowListeners.add(U.DragStart,Pt),this.windowListeners.add(U.VisibilityChange,this.handleCancel),this.windowListeners.add(U.ContextMenu,Pt),this.documentListeners.add(U.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Bt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(zt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(U.Click,lr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(U.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=et(t))!=null?n:q,u=Ze(o,c);if(!r&&a){if(zt(a)){if(a.tolerance!=null&>(u,a.tolerance))return this.handleCancel();if(gt(u,a.distance))return this.handleStart()}if(Bt(a)&>(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===S.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ur={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sn extends Dt{constructor(t){const{event:n}=t,r=xe(n.target);super(t,ur,r)}}sn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const dr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class fr extends Dt{constructor(t){super(t,dr,xe(t.event.target))}}fr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r?.({event:n}),!0)}}];const ht={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gr extends Dt{constructor(t){super(t,ht)}static setup(){return window.addEventListener(ht.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ht.move.name,t)};function t(){}}}gr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Le;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Le||(Le={}));var nt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nt||(nt={}));function hr(e){let{acceleration:t,activator:n=Le.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=nt.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const g=pr({delta:f,disabled:!i}),[D,v]=An(),p=l.useRef({x:0,y:0}),b=l.useRef({x:0,y:0}),y=l.useMemo(()=>{switch(n){case Le.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Le.DraggableRect:return o}},[n,o,c]),m=l.useRef(null),R=l.useCallback(()=>{const E=m.current;if(!E)return;const w=p.current.x*b.current.x,x=p.current.y*b.current.y;E.scrollBy(w,x)},[]),C=l.useMemo(()=>a===nt.TreeOrder?[...u].reverse():u,[a,u]);l.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of C){if(r?.(E)===!1)continue;const w=u.indexOf(E),x=d[w];if(!x)continue;const{direction:I,speed:N}=nr(E,x,y,t,h);for(const M of["x","y"])g[M][I[M]]||(N[M]=0,I[M]=0);if(N.x>0||N.y>0){v(),m.current=E,D(R,s),p.current=N,b.current=I;return}}p.current={x:0,y:0},b.current={x:0,y:0},v()},[t,R,r,v,i,s,JSON.stringify(y),JSON.stringify(g),D,u,C,d,JSON.stringify(h)])}const vr={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function pr(e){let{delta:t,disabled:n}=e;const r=Qe(t);return Fe(o=>{if(n||!r||!o)return vr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||i.x===-1,[L.Forward]:o.x[L.Forward]||i.x===1},y:{[L.Backward]:o.y[L.Backward]||i.y===-1,[L.Forward]:o.y[L.Forward]||i.y===1}}},[n,t,r])}function br(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function mr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ze||(ze={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Ft=new Map;function yr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=l.useState(null),{frequency:a,measure:c,strategy:u}=o,d=l.useRef(e),f=p(),h=Pe(f),g=l.useCallback(function(b){b===void 0&&(b=[]),!h.current&&s(y=>y===null?b:y.concat(b.filter(m=>!y.includes(m))))},[h]),D=l.useRef(null),v=Fe(b=>{if(f&&!n)return Ft;if(!b||b===Ft||d.current!==e||i!=null){const y=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){y.set(m.id,m.rect.current);continue}const R=m.node.current,C=R?new xt(c(R),R):null;m.rect.current=C,C&&y.set(m.id,C)}return y}return b},[e,i,n,f,c]);return l.useEffect(()=>{d.current=e},[e]),l.useEffect(()=>{f||g()},[n,f]),l.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),l.useEffect(()=>{f||typeof a!="number"||D.current!==null||(D.current=setTimeout(()=>{g(),D.current=null},a))},[a,f,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case ze.Always:return!1;case ze.BeforeDragging:return n;default:return!n}}}function Rt(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function wr(e,t){return Rt(e,t)}function xr(e){let{callback:t,disabled:n}=e;const r=ot(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function st(e){let{callback:t,disabled:n}=e;const r=ot(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return l.useEffect(()=>()=>o?.disconnect(),[o]),o}function Dr(e){return new xt(De(e),e)}function $t(e,t,n){t===void 0&&(t=Dr);const[r,o]=l.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const s=xr({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=st({callback:i});return V(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Rr(e){const t=Rt(e);return qt(e,t)}const Xt=[];function Cr(e){const t=l.useRef(e),n=Fe(r=>e?r&&r!==Xt&&e&&t.current&&e.parentNode===t.current.parentNode?r:wt(e):Xt,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Sr(e){const[t,n]=l.useState(null),r=l.useRef(e),o=l.useCallback(i=>{const s=ft(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return l.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(c=>{const u=ft(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{const u=ft(c);u?.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),q):tn(e):q,[e,t])}function Yt(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==q;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ze(e,n.current):q}function Er(e){l.useEffect(()=>{if(!rt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Ar(e,t){return l.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function an(e){return l.useMemo(()=>e?Qn(e):null,[e])}const jt=[];function Mr(e,t){t===void 0&&(t=De);const[n]=e,r=an(n?z(n):null),[o,i]=l.useState(jt);function s(){i(()=>e.length?e.map(c=>Zt(c)?r:new xt(t(c),c)):jt)}const a=st({callback:s});return V(()=>{a?.disconnect(),s(),e.forEach(c=>a?.observe(c))},[e]),o}function ln(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function Ir(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(u=>{for(const{target:d}of u)if(Be(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=st({callback:o}),s=l.useCallback(u=>{const d=ln(u);i?.disconnect(),d&&i?.observe(d),r(d?t(d):null)},[t,i]),[a,c]=_e(s);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Or=[{sensor:sn,options:{}},{sensor:on,options:{}}],Nr={current:{}},Je={draggable:{measure:kt},droppable:{measure:kt,strategy:ze.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:De}};class ke extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Tr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ke,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Je,measureDroppableContainers:tt,windowRect:null,measuringScheduled:!1},cn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tt,draggableNodes:new Map,over:null,measureDroppableContainers:tt},Xe=l.createContext(cn),un=l.createContext(Tr);function Lr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ke}}}function kr(e,t){switch(t.type){case T.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case T.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case T.DragEnd:case T.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case T.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ke(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case T.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new ke(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case T.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ke(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Pr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext(Xe),i=Qe(r),s=Qe(n?.id);return l.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!it(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=On(d);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function dn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function zr(e){return l.useMemo(()=>({draggable:{...Je.draggable,...e?.draggable},droppable:{...Je.droppable,...e?.droppable},dragOverlay:{...Je.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Br(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;V(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=qt(d,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Jt(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const at=l.createContext({...q,scaleX:1,scaleY:1});var ue;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ue||(ue={}));const wo=l.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Or,collisionDetection:f=Hn,measuring:h,modifiers:g,...D}=t;const v=l.useReducer(kr,void 0,Lr),[p,b]=v,[y,m]=zn(),[R,C]=l.useState(ue.Uninitialized),E=R===ue.Initialized,{draggable:{active:w,nodes:x,translate:I},droppable:{containers:N}}=p,M=w!=null?x.get(w):null,W=l.useRef({initial:null,translated:null}),H=l.useMemo(()=>{var P;return w!=null?{id:w,data:(P=M?.data)!=null?P:Nr,rect:W}:null},[w,M]),G=l.useRef(null),[Re,Ye]=l.useState(null),[F,je]=l.useState(null),Z=Pe(D,Object.values(D)),Ce=$e("DndDescribedBy",s),Ke=l.useMemo(()=>N.getEnabled(),[N]),B=zr(h),{droppableRects:ee,measureDroppableContainers:de,measuringScheduled:Se}=yr(Ke,{dragging:E,dependencies:[I.x,I.y],config:B.droppable}),j=br(x,w),Ue=l.useMemo(()=>F?et(F):null,[F]),oe=Sn(),te=wr(j,B.draggable.measure);Br({activeNode:w!=null?x.get(w):null,config:oe.layoutShiftCompensation,initialRect:te,measure:B.draggable.measure});const A=$t(j,B.draggable.measure,te),Ee=$t(j?j.parentElement:null),J=l.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=N.getNodeFor((n=J.current.over)==null?void 0:n.id),ne=Ir({measure:B.dragOverlay.measure}),he=(r=ne.nodeRef.current)!=null?r:j,ve=E?(o=ne.rect)!=null?o:A:null,Ct=!!(ne.nodeRef.current&&ne.rect),St=Rr(Ct?null:A),lt=an(he?z(he):null),ie=Cr(E?ge??j:null),We=Mr(ie),He=dn(g,{transform:{x:I.x-St.x,y:I.y-St.y,scaleX:1,scaleY:1},activatorEvent:F,active:H,activeNodeRect:A,containerNodeRect:Ee,draggingNodeRect:ve,over:J.current.over,overlayNodeRect:ne.rect,scrollableAncestors:ie,scrollableAncestorRects:We,windowRect:lt}),Et=Ue?ye(Ue,I):null,At=Sr(ie),mn=Yt(At),yn=Yt(At,[A]),pe=ye(He,mn),be=ve?Gn(ve,He):null,Ae=H&&be?f({active:H,collisionRect:be,droppableRects:ee,droppableContainers:Ke,pointerCoordinates:Et}):null,Mt=Un(Ae,"id"),[se,It]=l.useState(null),wn=Ct?He:ye(He,yn),xn=Vn(wn,(i=se?.rect)!=null?i:null,A),ct=l.useRef(null),Ot=l.useCallback((P,$)=>{let{sensor:X,options:ae}=$;if(G.current==null)return;const K=x.get(G.current);if(!K)return;const Y=P.nativeEvent,_=new X({active:G.current,activeNode:K,event:Y,options:ae,context:J,onAbort(k){if(!x.get(k))return;const{onDragAbort:Q}=Z.current,re={id:k};Q?.(re),y({type:"onDragAbort",event:re})},onPending(k,le,Q,re){if(!x.get(k))return;const{onDragPending:Ie}=Z.current,ce={id:k,constraint:le,initialCoordinates:Q,offset:re};Ie?.(ce),y({type:"onDragPending",event:ce})},onStart(k){const le=G.current;if(le==null)return;const Q=x.get(le);if(!Q)return;const{onDragStart:re}=Z.current,Me={activatorEvent:Y,active:{id:le,data:Q.data,rect:W}};Ne.unstable_batchedUpdates(()=>{re?.(Me),C(ue.Initializing),b({type:T.DragStart,initialCoordinates:k,active:le}),y({type:"onDragStart",event:Me}),Ye(ct.current),je(Y)})},onMove(k){b({type:T.DragMove,coordinates:k})},onEnd:me(T.DragEnd),onCancel:me(T.DragCancel)});ct.current=_;function me(k){return async function(){const{active:Q,collisions:re,over:Me,scrollAdjustedTranslate:Ie}=J.current;let ce=null;if(Q&&Ie){const{cancelDrop:Oe}=Z.current;ce={activatorEvent:Y,active:Q,collisions:re,delta:Ie,over:Me},k===T.DragEnd&&typeof Oe=="function"&&await Promise.resolve(Oe(ce))&&(k=T.DragCancel)}G.current=null,Ne.unstable_batchedUpdates(()=>{b({type:k}),C(ue.Uninitialized),It(null),Ye(null),je(null),ct.current=null;const Oe=k===T.DragEnd?"onDragEnd":"onDragCancel";if(ce){const ut=Z.current[Oe];ut?.(ce),y({type:Oe,event:ce})}})}}},[x]),Dn=l.useCallback((P,$)=>(X,ae)=>{const K=X.nativeEvent,Y=x.get(ae);if(G.current!==null||!Y||K.dndKit||K.defaultPrevented)return;const _={active:Y};P(X,$.options,_)===!0&&(K.dndKit={capturedBy:$.sensor},G.current=ae,Ot(X,$))},[x,Ot]),Nt=mr(d,Dn);Er(d),V(()=>{A&&R===ue.Initializing&&C(ue.Initialized)},[A,R]),l.useEffect(()=>{const{onDragMove:P}=Z.current,{active:$,activatorEvent:X,collisions:ae,over:K}=J.current;if(!$||!X)return;const Y={active:$,activatorEvent:X,collisions:ae,delta:{x:pe.x,y:pe.y},over:K};Ne.unstable_batchedUpdates(()=>{P?.(Y),y({type:"onDragMove",event:Y})})},[pe.x,pe.y]),l.useEffect(()=>{const{active:P,activatorEvent:$,collisions:X,droppableContainers:ae,scrollAdjustedTranslate:K}=J.current;if(!P||G.current==null||!$||!K)return;const{onDragOver:Y}=Z.current,_=ae.get(Mt),me=_&&_.rect.current?{id:_.id,rect:_.rect.current,data:_.data,disabled:_.disabled}:null,k={active:P,activatorEvent:$,collisions:X,delta:{x:K.x,y:K.y},over:me};Ne.unstable_batchedUpdates(()=>{It(me),Y?.(k),y({type:"onDragOver",event:k})})},[Mt]),V(()=>{J.current={activatorEvent:F,active:H,activeNode:j,collisionRect:be,collisions:Ae,droppableRects:ee,draggableNodes:x,draggingNode:he,draggingNodeRect:ve,droppableContainers:N,over:se,scrollableAncestors:ie,scrollAdjustedTranslate:pe},W.current={initial:ve,translated:be}},[H,j,Ae,be,x,he,ve,ee,N,se,ie,pe]),hr({...oe,delta:I,draggingRect:be,pointerCoordinates:Et,scrollableAncestors:ie,scrollableAncestorRects:We});const Rn=l.useMemo(()=>({active:H,activeNode:j,activeNodeRect:A,activatorEvent:F,collisions:Ae,containerNodeRect:Ee,dragOverlay:ne,draggableNodes:x,droppableContainers:N,droppableRects:ee,over:se,measureDroppableContainers:de,scrollableAncestors:ie,scrollableAncestorRects:We,measuringConfiguration:B,measuringScheduled:Se,windowRect:lt}),[H,j,A,F,Ae,Ee,ne,x,N,ee,se,de,ie,We,B,Se,lt]),Cn=l.useMemo(()=>({activatorEvent:F,activators:Nt,active:H,activeNodeRect:A,ariaDescribedById:{draggable:Ce},dispatch:b,draggableNodes:x,over:se,measureDroppableContainers:de}),[F,Nt,H,A,b,Ce,x,se,de]);return O.createElement(Vt.Provider,{value:m},O.createElement(Xe.Provider,{value:Cn},O.createElement(un.Provider,{value:Rn},O.createElement(at.Provider,{value:xn},u)),O.createElement(Pr,{disabled:a?.restoreFocus===!1})),O.createElement($n,{...a,hiddenTextDescribedById:Ce}));function Sn(){const P=Re?.autoScrollEnabled===!1,$=typeof c=="object"?c.enabled===!1:c===!1,X=E&&!P&&!$;return typeof c=="object"?{...c,enabled:X}:{enabled:X}}}),Fr=l.createContext(null),Kt="button",$r="Draggable";function Xr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e($r),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=l.useContext(Xe),{role:g=Kt,roleDescription:D="draggable",tabIndex:v=0}=o??{},p=c?.id===t,b=l.useContext(p?at:Fr),[y,m]=_e(),[R,C]=_e(),E=Ar(s,t),w=Pe(n);V(()=>(f.set(t,{id:t,key:i,node:y,activatorNode:R,data:w}),()=>{const I=f.get(t);I&&I.key===i&&f.delete(t)}),[f,t]);const x=l.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===Kt?!0:void 0,"aria-roledescription":D,"aria-describedby":d.draggable}),[r,g,v,p,D,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:x,isDragging:p,listeners:r?void 0:E,node:y,over:h,setNodeRef:m,setActivatorNodeRef:C,transform:b}}function fn(){return l.useContext(un)}const Yr="Droppable",jr={timeout:25};function Kr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(Yr),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=l.useContext(Xe),d=l.useRef({disabled:n}),f=l.useRef(!1),h=l.useRef(null),g=l.useRef(null),{disabled:D,updateMeasurementsFor:v,timeout:p}={...jr,...o},b=Pe(v??r),y=l.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),g.current=null},p)},[p]),m=st({callback:y,disabled:D||!s}),R=l.useCallback((x,I)=>{m&&(I&&(m.unobserve(I),f.current=!1),x&&m.observe(x))},[m]),[C,E]=_e(R),w=Pe(t);return l.useEffect(()=>{!m||!C.current||(m.disconnect(),f.current=!1,m.observe(C.current))},[C,m]),l.useEffect(()=>(a({type:T.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:h,data:w}}),()=>a({type:T.UnregisterDroppable,key:i,id:r})),[r]),l.useEffect(()=>{n!==d.current.disabled&&(a({type:T.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:c?.id===r,node:C,over:c,setNodeRef:E}}function Ur(e){let{animation:t,children:n}=e;const[r,o]=l.useState(null),[i,s]=l.useState(null),a=Qe(n);return!n&&!r&&a&&o(a),V(()=>{if(!i)return;const c=r?.key,u=r?.props.id;if(c==null||u==null){o(null);return}Promise.resolve(t(u,i)).then(()=>{o(null)})},[t,r,i]),O.createElement(O.Fragment,null,n,r?l.cloneElement(r,{ref:s}):null)}const Wr={x:0,y:0,scaleX:1,scaleY:1};function Hr(e){let{children:t}=e;return O.createElement(Xe.Provider,{value:cn},O.createElement(at.Provider,{value:Wr},t))}const Vr={position:"fixed",touchAction:"none"},qr=e=>it(e)?"transform 250ms ease":void 0,Gr=l.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:c,transform:u,transition:d=qr}=e;if(!a)return null;const f=o?u:{...u,scaleX:1,scaleY:1},h={...Vr,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:o&&r?Yn(r,a):void 0,transition:typeof d=="function"?d(r):d,...c};return O.createElement(n,{className:s,style:h,ref:t},i)}),Jr=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[c,u]of Object.entries(o))n.node.style.setProperty(c,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},_r=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fe.Transform.toString(t)},{transform:fe.Transform.toString(n)}]},Qr={duration:250,easing:"ease",keyframes:_r,sideEffects:Jr({styles:{active:{opacity:"0"}}})};function Zr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return ot((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=ln(s);if(!u)return;const{transform:d}=z(s).getComputedStyle(s),f=Gt(d);if(!f)return;const h=typeof t=="function"?t:eo(t);return nn(c,o.draggable.measure),h({active:{id:i,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function eo(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Qr,...e};return i=>{let{active:s,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:c.scaleX!==1?s.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?s.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-d.x,y:c.y-d.y,...f},g=o({...u,active:s,dragOverlay:a,transform:{initial:c,final:h}}),[D]=g,v=g[g.length-1];if(JSON.stringify(D)===JSON.stringify(v))return;const p=r?.({active:s,dragOverlay:a,...u}),b=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{p?.(),y()}})}}let Ut=0;function to(e){return l.useMemo(()=>{if(e!=null)return Ut++,Ut},[e])}const xo=O.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:D,droppableContainers:v,dragOverlay:p,over:b,measuringConfiguration:y,scrollableAncestors:m,scrollableAncestorRects:R,windowRect:C}=fn(),E=l.useContext(at),w=to(f?.id),x=dn(s,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:p.rect,over:b,overlayNodeRect:p.rect,scrollableAncestors:m,scrollableAncestorRects:R,transform:E,windowRect:C}),I=Rt(h),N=Zr({config:r,draggableNodes:D,droppableContainers:v,measuringConfiguration:y}),M=I?p.setRef:void 0;return O.createElement(Hr,null,O.createElement(Ur,{animation:N},f&&w?O.createElement(Gr,{key:w,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:I,style:{zIndex:u,...o},transform:x},n):null))});function gn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function no(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ve(e){return e!==null&&e>=0}function ro(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const qe={scaleX:1,scaleY:1},Do=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const c=io(n,s,o);if(s===o){const u=n[i];return u?{x:o<i?u.left+u.width-(a.left+a.width):u.left-a.left,y:0,...qe}:null}return s>o&&s<=i?{x:-a.width-c,y:0,...qe}:s<o&&s>=i?{x:a.width+c,y:0,...qe}:{x:0,y:0,...qe}};function io(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const hn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=gn(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},Ge={scaleX:1,scaleY:1},Ro=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...Ge}:null}const c=so(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-c,...Ge}:o<n&&o>=s?{x:0,y:a.height+c,...Ge}:{x:0,y:0,...Ge}};function so(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const vn="Sortable",pn=O.createContext({activeIndex:-1,containerId:vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hn,disabled:{draggable:!1,droppable:!1}});function Co(e){let{children:t,id:n,items:r,strategy:o=hn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=fn(),f=$e(vn,n),h=a.rect!==null,g=l.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),D=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,b=l.useRef(g),y=!ro(g,b.current),m=p!==-1&&v===-1||y,R=oo(i);V(()=>{y&&D&&d(g)},[y,g,D,d]),l.useEffect(()=>{b.current=g},[g]);const C=l.useMemo(()=>({activeIndex:v,containerId:f,disabled:R,disableTransforms:m,items:g,overIndex:p,useDragOverlay:h,sortedRects:no(g,c),strategy:o}),[v,f,R.draggable,R.droppable,m,g,p,c,h,o]);return O.createElement(pn.Provider,{value:C},t)}const ao=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return gn(n,r,o).indexOf(t)},lo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===c},co={duration:200,easing:"ease"},bn="transform",uo=fe.Transition.toString({property:bn,duration:0,easing:"linear"}),fo={roleDescription:"sortable"};function go(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=l.useState(null),a=l.useRef(n);return V(()=>{if(!t&&n!==a.current&&r.current){const c=o.current;if(c){const u=De(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&s(d)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{i&&s(null)},[i]),i}function So(e){let{animateLayoutChanges:t=lo,attributes:n,disabled:r,data:o,getNewIndex:i=ao,id:s,strategy:a,resizeObserverConfig:c,transition:u=co}=e;const{items:d,containerId:f,activeIndex:h,disabled:g,disableTransforms:D,sortedRects:v,overIndex:p,useDragOverlay:b,strategy:y}=l.useContext(pn),m=ho(r,g),R=d.indexOf(s),C=l.useMemo(()=>({sortable:{containerId:f,index:R,items:d},...o}),[f,o,R,d]),E=l.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:w,node:x,isOver:I,setNodeRef:N}=Kr({id:s,data:C,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:M,activatorEvent:W,activeNodeRect:H,attributes:G,setNodeRef:Re,listeners:Ye,isDragging:F,over:je,setActivatorNodeRef:Z,transform:Ce}=Xr({id:s,data:C,attributes:{...fo,...n},disabled:m.draggable}),Ke=En(N,Re),B=!!M,ee=B&&!D&&Ve(h)&&Ve(p),de=!b&&F,Se=de&&ee?Ce:null,Ue=ee?Se??(a??y)({rects:v,activeNodeRect:H,activeIndex:h,overIndex:p,index:R}):null,oe=Ve(h)&&Ve(p)?i({id:s,items:d,activeIndex:h,overIndex:p}):R,te=M?.id,A=l.useRef({activeId:te,items:d,newIndex:oe,containerId:f}),Ee=d!==A.current.items,J=t({active:M,containerId:f,isDragging:F,isSorting:B,id:s,index:R,items:d,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),ge=go({disabled:!J,index:R,node:x,rect:w});return l.useEffect(()=>{B&&A.current.newIndex!==oe&&(A.current.newIndex=oe),f!==A.current.containerId&&(A.current.containerId=f),d!==A.current.items&&(A.current.items=d)},[B,oe,f,d]),l.useEffect(()=>{if(te===A.current.activeId)return;if(te!=null&&A.current.activeId==null){A.current.activeId=te;return}const he=setTimeout(()=>{A.current.activeId=te},50);return()=>clearTimeout(he)},[te]),{active:M,activeIndex:h,attributes:G,data:C,rect:w,index:R,newIndex:oe,items:d,isOver:I,isSorting:B,isDragging:F,listeners:Ye,node:x,overIndex:p,over:je,setNodeRef:Ke,setActivatorNodeRef:Z,setDroppableNodeRef:N,setDraggableNodeRef:Re,transform:ge??Ue,transition:ne()};function ne(){if(ge||Ee&&A.current.newIndex===R)return uo;if(!(de&&!it(W)||!u)&&(B||J))return fe.Transition.toString({...u,property:bn})}}function ho(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}S.Down,S.Right,S.Up,S.Left;export{fe as C,wo as D,on as K,sn as P,Co as S,mo as a,bo as b,yo as c,xo as d,Kr as e,gn as f,So as g,Do as h,Xr as u,Ro as v};
|