@mohsinonxrm/pptb-dataverse-request-studio 1.5.0-beta.1 → 1.6.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 +380 -0
- package/README.md +44 -18
- package/dist/assets/ActionParamForm-DvTh6hUs.js +1 -0
- package/dist/assets/AllOrNothingOption-C7wGq_-r.js +1 -0
- package/dist/assets/AssociateMode-Dj-iEObO.js +1 -0
- package/dist/assets/BatchMode-Dsa1JVpd.js +10 -0
- package/dist/assets/BinaryColumnPickers-NAaoPcPt.js +1 -0
- package/dist/assets/BinaryPipelineCard-CSklRaME.js +1 -0
- package/dist/assets/BulkDeleteMode-Cqpb47QI.js +1 -0
- package/dist/assets/BulkWriteMode-CRkiw89Q.js +6 -0
- package/dist/assets/CodeView-C65Y5vXN.js +874 -0
- package/dist/assets/CreateMode-CwGffdDR.js +1 -0
- package/dist/assets/DeleteMode-CaWEZkJ1.js +1 -0
- package/dist/assets/DisassociateMode-Ddk9Jm3g.js +2 -0
- package/dist/assets/ExecuteActionMode-BbN_9350.js +1 -0
- package/dist/assets/ExecuteFunctionMode-G3PFBDpl.js +1 -0
- package/dist/assets/ExecuteWorkflowMode-D2MxIt5s.js +1 -0
- package/dist/assets/FieldSetEditor-Dg6WsDgG.js +3 -0
- package/dist/assets/ImportCurlDialog-BiURYtjH.js +7 -0
- package/dist/assets/ManageAttachmentMode-D14EZog8.js +1 -0
- package/dist/assets/ManageFileMode-DMLRV2xg.js +1 -0
- package/dist/assets/ManageImageMode-CoSAt9yh.js +1 -0
- package/dist/assets/MergeMode-PfbLAjOh.js +1 -0
- package/dist/assets/OptionGroup-DYAAm_pt.js +1 -0
- package/dist/assets/PredefinedQueryMode-CdT1I6jB.js +1 -0
- package/dist/assets/RetrieveNextLinkMode-BK9KD3q6.js +1 -0
- package/dist/assets/RetrieveSingleMode-_y2Z1G7C.js +1 -0
- package/dist/assets/UpdateMode-Dvd6cr4i.js +1 -0
- package/dist/assets/UpsertMode-BuyV7FEg.js +1 -0
- package/dist/assets/WriteResultCard-N_Ewu4dP.js +1 -0
- package/dist/assets/bypassAdvisories-BhBeq_oI.js +1 -0
- package/dist/assets/decodeForDisplay-D55DM53E.js +1 -0
- package/dist/assets/index-NW0Z4UWR.js +42 -0
- package/dist/assets/javascript-Dti3Ss-T.js +1 -0
- package/dist/assets/{jsonMode-DOHFeg2H.js → jsonMode-YuJX0ZcQ.js} +1 -1
- package/dist/assets/jsonWorkerInPage-CTjyykdK.js +33 -0
- package/dist/assets/{monacoSetup-CEhMjQNN.js → monacoSetup-Bxl8fgYX.js} +176 -176
- package/dist/assets/multipart-Bd_eOd8a.js +4 -0
- package/dist/assets/{python-DDgBOsRh.js → python-CZnGM3Qv.js} +1 -1
- package/dist/assets/writeResultName-Dw705_0B.js +1 -0
- package/dist/assets/writeState-DgYICTBE.js +1 -0
- package/dist/assets/{xml-BXhJpCm5.js → xml-gySD1GMR.js} +1 -1
- package/dist/icons/icon.svg +9 -6
- package/dist/index.html +7 -1
- package/index.html +6 -0
- package/package.json +2 -1
- package/dist/assets/AssociateMode-mu2ai0TV.js +0 -1
- package/dist/assets/AssociateTargetsEditor-BoH9Qxe8.js +0 -1
- package/dist/assets/BatchMode-BVAfFgPy.js +0 -11
- package/dist/assets/BinaryColumnPickers-DYpKoRIO.js +0 -1
- package/dist/assets/BulkDeleteMode-Df-XirlR.js +0 -1
- package/dist/assets/BulkWriteMode-UXREEvbe.js +0 -6
- package/dist/assets/DisassociateMode-CKBL5nUo.js +0 -2
- package/dist/assets/ExecuteWorkflowMode-4EWco-ze.js +0 -1
- package/dist/assets/ManageFileMode-BFNwxuEY.js +0 -1
- package/dist/assets/ManageImageMode-DX0AdPN1.js +0 -1
- package/dist/assets/MergeMode-BzyXLu1b.js +0 -1
- package/dist/assets/PredefinedQueryMode-BT-HdZHF.js +0 -1
- package/dist/assets/RetrieveNextLinkMode-QBuIwdgS.js +0 -1
- package/dist/assets/abap-CRCWOmpq.js +0 -1
- package/dist/assets/apex-DnsZk_dE.js +0 -1
- package/dist/assets/azcli-1IWB1ccx.js +0 -1
- package/dist/assets/bat-DPkNLes8.js +0 -1
- package/dist/assets/bicep-Corcdgou.js +0 -2
- package/dist/assets/cameligo-CGrWLZr3.js +0 -1
- package/dist/assets/clojure-D9WOWImG.js +0 -1
- package/dist/assets/coffee-B7EJu28W.js +0 -1
- package/dist/assets/cpp-SEyurbux.js +0 -1
- package/dist/assets/csp-C46ZqvIl.js +0 -1
- package/dist/assets/css-DQU6DXDx.js +0 -3
- package/dist/assets/css.worker-CwQehIRV.js +0 -93
- package/dist/assets/cssMode-DRNC4UuD.js +0 -4
- package/dist/assets/cypher-D84EuPTj.js +0 -1
- package/dist/assets/dart-D8lhlL1r.js +0 -1
- package/dist/assets/dockerfile-DLk6rpji.js +0 -1
- package/dist/assets/ecl-BO6FnfXk.js +0 -1
- package/dist/assets/elixir-BRjLKONM.js +0 -1
- package/dist/assets/flow9-Cac8vKd7.js +0 -1
- package/dist/assets/freemarker2-BITb8GyO.js +0 -3
- package/dist/assets/fsharp-fd1GTHhf.js +0 -1
- package/dist/assets/go-O9LJTZXk.js +0 -1
- package/dist/assets/graphql-LQdxqEYJ.js +0 -1
- package/dist/assets/handlebars-BbDVduNH.js +0 -1
- package/dist/assets/hcl-DxDQ3s82.js +0 -1
- package/dist/assets/html-Ru2Cy2VS.js +0 -1
- package/dist/assets/html.worker-4xVL0wjo.js +0 -470
- package/dist/assets/htmlMode-DeMh8vPt.js +0 -4
- package/dist/assets/index-XmEQbXiX.js +0 -703
- package/dist/assets/ini-BvajGCUy.js +0 -1
- package/dist/assets/java-SYsfObOQ.js +0 -1
- package/dist/assets/javascript-DLj2yjBO.js +0 -1
- package/dist/assets/julia-DQXNmw_w.js +0 -1
- package/dist/assets/kotlin-qQ0MG-9I.js +0 -1
- package/dist/assets/less-GGFNNJHn.js +0 -2
- package/dist/assets/lexon-Canl7DCW.js +0 -1
- package/dist/assets/liquid-udbJGOUP.js +0 -1
- package/dist/assets/lua-D28Ae8-K.js +0 -1
- package/dist/assets/m3-DPitgjJI.js +0 -1
- package/dist/assets/markdown-B811l8j2.js +0 -1
- package/dist/assets/mdx-B6ABiFDH.js +0 -1
- package/dist/assets/mips-CdjsipkG.js +0 -1
- package/dist/assets/msdax-CYqgjx_P.js +0 -1
- package/dist/assets/mysql-BHd6q0vd.js +0 -1
- package/dist/assets/objective-c-B1aVtJYH.js +0 -1
- package/dist/assets/pascal-BhNW15KB.js +0 -1
- package/dist/assets/pascaligo-5jv8CcQD.js +0 -1
- package/dist/assets/perl-DlYyT36c.js +0 -1
- package/dist/assets/pgsql-Dy0bjov7.js +0 -1
- package/dist/assets/php-120yhfDK.js +0 -1
- package/dist/assets/pla-CjnFlu4u.js +0 -1
- package/dist/assets/postiats-CQpG440k.js +0 -1
- package/dist/assets/powerquery-DdJtto1Z.js +0 -1
- package/dist/assets/protobuf-IBS6jZEB.js +0 -2
- package/dist/assets/pug-kFxLfcjb.js +0 -1
- package/dist/assets/qsharp-q7JyzKFN.js +0 -1
- package/dist/assets/r-BIFz-_sK.js +0 -1
- package/dist/assets/razor-DGf0KCTP.js +0 -1
- package/dist/assets/redis-CHOsPHWR.js +0 -1
- package/dist/assets/redshift-CBifECDb.js +0 -1
- package/dist/assets/restructuredtext-CghPJEOS.js +0 -1
- package/dist/assets/ruby-CYWGW-b1.js +0 -1
- package/dist/assets/rust-DMDD0SHb.js +0 -1
- package/dist/assets/sb-BYAiYHFx.js +0 -1
- package/dist/assets/scala-Bqvq8jcR.js +0 -1
- package/dist/assets/scheme-Dhb-2j9p.js +0 -1
- package/dist/assets/scss-CTwUZ5N7.js +0 -3
- package/dist/assets/solidity-CME5AdoB.js +0 -1
- package/dist/assets/sophia-RYC1BQQz.js +0 -1
- package/dist/assets/sparql-KEyrF7De.js +0 -1
- package/dist/assets/sql-BdTr02Mf.js +0 -1
- package/dist/assets/st-C7iG7M4S.js +0 -1
- package/dist/assets/swift-D7IUmUK8.js +0 -1
- package/dist/assets/systemverilog-DgMryOEJ.js +0 -1
- package/dist/assets/tcl-PloMZuKG.js +0 -1
- package/dist/assets/ts.worker-B8Ae6930.js +0 -51330
- package/dist/assets/tsMode-D4ZDTisA.js +0 -11
- package/dist/assets/twig-BfRIq3la.js +0 -1
- package/dist/assets/typescript-CJFgy1iR.js +0 -1
- package/dist/assets/typespec-CzxlYoT_.js +0 -1
- package/dist/assets/vb-BwAE3J76.js +0 -1
- package/dist/assets/wgsl-Dksx_ONF.js +0 -298
- package/dist/assets/yaml-B7iGwJkY.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b8 as re,A as e,br as je,a2 as w,l as o,a3 as v,ab as se,N as L,O as C,V as z,bq as b,k as Se,b9 as ve,c6 as Q,c7 as Ee,c8 as Ie,u as Ne,f as Pe,n as Te,bc as Le,c9 as Ce,be as Re,p as O,q as X,t as qe,ca as R,cb as Ae,T as Z,v as We,L as Me,z as $e,H as Be,ah as ne,ad as ae,b6 as Fe,I as ee,J as De,K as He,P as Oe,R as ze,U as Ve,S as Ue,cc as _e,Y as Ge,Z as Ke,bn as Ye,b5 as te,Q as Je,b0 as Qe,b1 as Xe,bs as Ze}from"./index-XmEQbXiX.js";function et({rows:i,keyWidth:s,className:c}){const t=re(),n=s!=null?{gridTemplateColumns:`${typeof s=="number"?`${s}px`:s} 1fr`}:void 0;return e.jsx("div",{className:je(t.kvGrid,c),style:n,children:i.map((u,l)=>e.jsx(tt,{k:u.k,v:u.v,mono:u.mono},l))})}function tt({k:i,v:s,mono:c}){const t=re();return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:t.kvKey,children:i}),e.jsx("span",{className:c?t.kvValMono:t.kvVal,children:s==null||s===""?e.jsx("em",{style:{color:w.colorNeutralForeground4},children:"—"}):s})]})}const rt="http://schemas.microsoft.com/winfx/2006/xaml",st=new Set(["InputEntities","CreatedEntities"]);function nt(i){if(!i||typeof DOMParser>"u")return[];let s;try{s=new DOMParser().parseFromString(i,"application/xml")}catch{return[]}if(s.getElementsByTagName("parsererror").length>0)return[];const c=[],t=s.getElementsByTagNameNS(rt,"Property");for(const n of Array.from(t)){const u=n.getAttribute("Name"),l=/^(In|InOut)Argument\((.*)\)$/.exec((n.getAttribute("Type")??"").trim());if(!u||!l||st.has(u))continue;let y=!1,h=null;for(const g of Array.from(n.getElementsByTagName("*"))){const a=g.getAttribute("Value");g.localName==="ArgumentRequiredAttribute"&&(y=a?.toLowerCase()==="true"),g.localName==="ArgumentDescriptionAttribute"&&a&&(h=a)}c.push({name:u,direction:l[1],type:l[2].trim(),required:y,description:h})}return c}function at(i){return i.replace(/\b[a-z]+:/g,"")}function ot({workflowId:i}){const[s,c]=o.useState({status:"loading"});o.useEffect(()=>{if(typeof window>"u"||!window.dataverseAPI?.queryData){c({status:"ready",args:[]});return}let n=!1;return c({status:"loading"}),window.dataverseAPI.queryData(`workflows?$select=xaml&$filter=workflowid eq ${i}`).then(u=>{if(n)return;const l=u?.value?.[0],y=typeof l?.xaml=="string"?l.xaml:null;c({status:"ready",args:nt(y)})}).catch(u=>{n||c({status:"error",message:u instanceof Error?u.message:String(u)})}),()=>{n=!0}},[i]);const t={color:w.colorNeutralForeground3,display:"block",marginTop:10};return s.status==="loading"?e.jsxs(v,{style:{...t,display:"flex",alignItems:"center",gap:6},children:[e.jsx(se,{size:"extra-tiny"})," Reading the workflow's input arguments…"]}):s.status==="error"?e.jsxs(v,{style:t,children:["Couldn't read the workflow definition to check for input arguments: ",s.message]}):s.args.length===0?e.jsxs(v,{style:t,children:["No input arguments declared — ",e.jsx("code",{children:"EntityId"})," is the whole request body."]}):e.jsx(L,{layout:"multiline",intent:"warning",style:{marginTop:12},children:e.jsxs(C,{children:[e.jsxs(z,{children:["This workflow declares ",s.args.length," input argument",s.args.length===1?"":"s"]}),"The Web API ",e.jsx("code",{children:"ExecuteWorkflow"})," action only takes ",e.jsx("code",{children:"EntityId"}),", so these can't be set from here; the workflow runs with their default values.",e.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18},children:s.args.map(n=>e.jsxs("li",{children:[e.jsx("code",{children:n.name})," ",e.jsx(b,{appearance:"outline",size:"small",children:at(n.type)}),n.direction==="InOut"&&e.jsx(b,{appearance:"tint",size:"small",style:{marginLeft:4},children:"in/out"}),n.required&&e.jsx(b,{appearance:"tint",color:"danger",size:"small",style:{marginLeft:4},children:"required"}),n.description&&e.jsxs("span",{style:{color:w.colorNeutralForeground3},children:[" — ",n.description]})]},n.name))})]})})}const it=()=>({workflowId:null,entityId:null,headers:Je(),dirty:new Set});function ut({themeMode:i}){const s=Se("exec-workflow"),c=ve("exec-workflow",Q,it),[t,n]=o.useState(c.state),[u,l]=o.useState("pick"),[y,h]=o.useState("builder"),[g,a]=o.useState(null),[p,j]=o.useState(!1),[q,A]=o.useState([]),E=o.useMemo(()=>Ee(t),[t]),oe=o.useMemo(()=>Ie(t),[t]),[W,V]=o.useState([]),[ie,M]=o.useState(!1),[le,$]=o.useState(null),[de,ce]=o.useState(0),ue=typeof window<"u"&&!!window.dataverseAPI?.queryData;o.useEffect(()=>{let r=!1;if(typeof window>"u"||!window.dataverseAPI?.queryData){V([]),$("Workflows can only be loaded from a live Dataverse connection (PPTB).");return}return M(!0),$(null),window.dataverseAPI.queryData("workflows?$select=workflowid,name,uniquename,primaryentity,description&$filter=(statecode eq 1 and type eq 1 and ondemand eq true and category eq 0)&$orderby=name asc").then(f=>{if(r)return;const x=f?.value??[];V(x.map(k=>({id:String(k.workflowid??""),name:String(k.name??"(unnamed)"),uniqueName:k.uniquename!=null?String(k.uniquename):null,primaryEntity:String(k.primaryentity??""),description:k.description!=null?String(k.description):null}))),M(!1)}).catch(f=>{r||($(f instanceof Error?f.message:String(f)),M(!1))}),()=>{r=!0}},[de]);const d=t.workflowId?W.find(r=>r.id===t.workflowId):void 0;Ne(d?.primaryEntity??null);const I=d?Pe(d.primaryEntity):void 0,{allEntities:U}=Te(),[N,B]=o.useState(c.lastSavedId),[P,F]=o.useState(c.lastSavedHash),[me,D]=o.useState(""),H=r=>n(m=>{const f=new Set(m.dirty);return f.add(r),{...m,dirty:f}}),_=(r,m,f)=>{n(x=>({...x,[r]:m})),f&&H(f)},fe=Le([["Workflow id",t.workflowId],["Record id",t.entityId]]),ye=d?t.entityId?t.headers.some(r=>r.enabled&&!r.name)?"Fix empty header name.":fe:`Pick a ${d.primaryEntity} record to run the workflow on.`:"Pick a workflow.",he=async()=>{j(!0);const r=await Xe.workflow(t,ee(t.headers,null));a(r),j(!1),h("results"),A(m=>[{id:`r-${Date.now()}`,snapshot:S,modeId:"exec-workflow",url:E.relativeUrl,method:"POST",ts:Date.now(),status:r.status,ms:r.ms,rowCount:r.ok?1:0},...m].slice(0,8)),n(m=>({...m,dirty:new Set}))},S=o.useMemo(()=>Ce(t),[t]);Re("exec-workflow",S,N,P);const pe=o.useMemo(()=>O(S),[S]),G=P===null?!0:pe!==P,we=r=>{B(r.id),F(O(r.state))},K=r=>{if(r.modeId!=="exec-workflow")return;const m=r.state,f=W.find(x=>x.id===m.workflowId);if(f&&U.length>0&&!U.some(x=>x.logicalName===f.primaryEntity)){Qe(`Can't load "${r.name}": workflow's primary entity \`${f.primaryEntity}\` isn't available in this environment.`);return}n(Q(m)),B(r.id),F(O(m)),a(null),D(""),l("pick")},ge=r=>{const m=Ze(r,"exec-workflow");if(!m)return;const f=N,x=P;K(m),B(f),F(x)},Y=X(we),J=X(K);qe(o.useMemo(()=>t.workflowId?{state:S,modeId:"exec-workflow",dirty:G,lastSavedId:N,onSaved:Y,onLoadSaved:J}:null,[S,G,N,t.workflowId,Y,J]));const xe=[{id:"workflow",label:"Target",meta:d?.name??"pick one",items:[{id:"pick",icon:Ae,iconFilled:R,label:d?.name??"Pick on-demand workflow",dirty:t.dirty.has("pick")}]},{id:"target",label:"Bound to",meta:d?`${I?.displayName??d.primaryEntity} record`:"—",items:[{id:"target",icon:We,iconFilled:Z,label:t.entityId?`${I?.displayName??""} (selected)`:"Pick a record",badge:t.entityId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("target")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(r=>r.enabled).length} active`,items:[{id:"headers",icon:$e,iconFilled:Me,label:"HTTP headers",badge:t.headers.filter(r=>r.enabled).length||null,dirty:t.dirty.has("headers")}]}];let T;switch(u){case"pick":T=e.jsx(lt,{workflows:W,loading:ie,error:le,onRetry:ue?()=>ce(r=>r+1):void 0,workflowId:t.workflowId,setWorkflowId:r=>{n(m=>({...m,workflowId:r,entityId:null})),D(""),H("pick"),H("target")}});break;case"target":T=d?e.jsxs("div",{children:[e.jsx(ne,{icon:Z,title:"Target record",sub:`The ${I?.displayName??d.primaryEntity} record the workflow operates on. Slots into the request body as "EntityId".`,group:"execute"}),e.jsxs("div",{style:{maxWidth:480},children:[e.jsx(ae,{label:`${I?.displayName??d.primaryEntity} record`,children:e.jsx(Fe,{table:d.primaryEntity,selectedId:t.entityId,onPick:r=>{_("entityId",r?.id??null,"target"),D(r?.primary??"")},placeholder:`Search ${I?.displayName??d.primaryEntity} records…`})}),e.jsx(ot,{workflowId:d.id})]})]}):e.jsx(L,{layout:"multiline",intent:"info",children:e.jsx(C,{children:"Pick a workflow first."})});break;case"headers":T=e.jsx(Be,{items:t.headers,setItems:r=>_("headers",r,"headers"),group:"execute",sendsHeaders:!0});break}const ke=ee(t.headers,null),be={method:"POST",built:E,headers:ke,body:oe,entityLogical:E.entityLogical};return e.jsx(De,{sidebar:e.jsx(Ue,{type:s,urlPreview:E.relativeNoBase,sections:xe,activeNode:u,onSelect:r=>{l(r),h("builder")},recents:q,onRecentClick:ge}),urlBar:e.jsx(Ve,{method:"POST",url:E.relativeUrl,executeVerb:s.executeVerb,writeConfirm:d?{operation:`Execute Workflow "${d.name}"`,table:d.primaryEntity||void 0,scope:{kind:"records",count:1},highImpact:!0}:null,executeIcon:R,disabledReason:ye,loading:p,onExecute:he}),children:e.jsxs(He,{tab:y,onTabChange:h,resultCount:g?.ok?1:null,children:[y==="builder"&&T,y==="code"&&e.jsx(Oe,{themeMode:i,inputs:be}),y==="results"&&e.jsx(ze,{result:g,mode:"single",table:d?.primaryEntity??"",writeContext:{operation:"workflow",table:d?.primaryEntity??"",recordId:t.entityId,recordName:me||null,operationName:d?.name??void 0}})]})})}function lt({workflows:i,loading:s,error:c,onRetry:t,workflowId:n,setWorkflowId:u}){const l=n?i.find(a=>a.id===n):void 0,[y,h]=o.useState("");o.useEffect(()=>{h(l?.name??"")},[l?.name]);const g=o.useMemo(()=>{const a=y.trim().toLowerCase();return!a||a===(l?.name??"").toLowerCase()?i:i.filter(p=>p.name.toLowerCase().includes(a)||(p.uniqueName?.toLowerCase().includes(a)??!1)||p.primaryEntity.toLowerCase().includes(a)||(p.description?.toLowerCase().includes(a)??!1))},[i,y,l]);return e.jsxs("div",{children:[e.jsx(ne,{icon:R,title:"On-demand workflow",sub:"Pick an activated workflow (type=Definition, category=Workflow). The workflow's primary entity drives the Target picker.",group:"execute",children:s?e.jsx(b,{appearance:"ghost",icon:e.jsx(se,{size:"extra-tiny"}),children:"loading…"}):c?null:e.jsxs(b,{appearance:"ghost",children:[i.length," workflow",i.length===1?"":"s"]})}),c&&!s&&e.jsxs(L,{intent:"error",layout:"multiline",style:{marginBottom:12,maxWidth:760},children:[e.jsxs(C,{children:[e.jsx(z,{children:"Couldn't load workflows"}),c]}),t&&e.jsx(_e,{containerAction:e.jsx(Ge,{appearance:"primary",size:"small",icon:e.jsx(Ke,{}),onClick:t,children:"Retry"})})]}),e.jsxs("div",{style:{maxWidth:760},children:[e.jsx(ae,{label:"Workflow",children:e.jsxs(Ye,{freeform:!0,clearable:!0,value:y,selectedOptions:n?[n]:[],onChange:a=>{const p=a.target.value;h(p),p===""&&n&&u(null)},onOptionSelect:(a,p)=>{const j=p.optionValue??null;if(u(j),j){const q=i.find(A=>A.id===j);h(q?.name??"")}else h("")},placeholder:s?"Loading workflows…":c?"Workflows didn’t load":i.length===0?"No activated workflows in this environment":"Search workflows…",disabled:s||i.length===0,listbox:{style:{maxHeight:420}},children:[g.length===0&&y.trim()&&e.jsx(te,{value:"__none",text:"",disabled:!0,children:e.jsxs(v,{style:{color:w.colorNeutralForeground3},children:['No workflows match "',y.trim(),'"']})}),g.map(a=>e.jsx(te,{value:a.id,text:a.name,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:a.name}),e.jsxs(v,{style:{color:w.colorNeutralForeground3},children:["Primary entity:"," ",e.jsx("span",{style:{fontFamily:w.fontFamilyMonospace},children:a.primaryEntity}),a.description?` · ${a.description}`:""]})]})},a.id))]})}),l&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${w.colorNeutralStroke2}`,borderRadius:w.borderRadiusMedium,background:w.colorNeutralBackground1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(R,{style:{color:w.colorBrandForeground1}}),e.jsx("strong",{style:{fontSize:13},children:l.name}),e.jsx(b,{appearance:"ghost",children:l.primaryEntity}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(b,{appearance:"filled",color:"success",style:{fontWeight:700},children:"POST"})]}),e.jsx(v,{style:{color:w.colorNeutralForeground2,display:"block",marginBottom:8},children:l.description}),e.jsx(et,{keyWidth:120,rows:[{k:"Workflow id",v:l.id,mono:!0},{k:"Primary entity",v:l.primaryEntity,mono:!0},{k:"URL shape",v:`POST /workflows(${l.id})/Microsoft.Dynamics.CRM.ExecuteWorkflow`,mono:!0},{k:"Body shape",v:'{ "EntityId": "<target-guid>" }',mono:!0},{k:"Response",v:"204 No Content — workflow runs async"}]}),e.jsx(L,{layout:"multiline",intent:"info",style:{marginTop:12},children:e.jsxs(C,{children:[e.jsx(z,{children:"Workflow runs are asynchronous."}),"The 204 only confirms the request was accepted. Check the ",e.jsx("code",{children:"workflowlogs"})," ","/ ",e.jsx("code",{children:"asyncoperations"})," tables for completion + result."]})})]})]})]})}export{ut as ExecuteWorkflowMode,lt as WorkflowPickerPane};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as xe,b9 as ke,cd as Q,l as r,u as Se,ce as je,cf as ve,f as Fe,bc as we,n as Ce,cg as Te,be as Be,p as E,q as X,t as ze,aq as Me,ch as Pe,A as e,ci as ae,cj as Ae,T as Ne,v as Re,ck as Z,cl as ee,aS as H,aT as De,bY as Ie,cm as Ue,L as Le,z as Ee,cn as A,H as He,co as qe,cp as Oe,cq as $e,D as Ge,I as Ve,cr as We,J as _e,K as Ke,P as Ye,R as Je,U as Qe,cs as Xe,ct as Ze,cu as ea,S as aa,Q as la,b0 as sa,N as z,O as M,V as P,ah as q,ad as g,ai as le,aj as b,a2 as o,a3 as u,ak as v,b8 as oa,cv as ta,br as na,b1 as ia,bs as ra}from"./index-XmEQbXiX.js";import{F as da}from"./BinaryColumnPickers-DYpKoRIO.js";const ca=()=>({table:"",recordId:null,fileColumn:"",operation:"upload",uploadMethod:{kind:"chunked-patch",chunkSize:2*1024*1024},downloadMethod:{kind:"single-request"},source:{kind:"file"},fileName:"",fileSize:0,mimeType:"application/octet-stream",bodyBase64:"",bodyUrl:"",headers:la(),dirty:new Set});function ya({themeMode:s}){const n=xe("manage-file"),d=ke("manage-file",Q,ca),[a,i]=r.useState(d.state),{table:f}=Se(a.table||null),[O,N]=r.useState("pipeline"),[F,R]=r.useState("builder"),[$,D]=r.useState(null),[se,G]=r.useState(!1),[oe,te]=r.useState([]),x=r.useMemo(()=>je(a),[a,f]),p=r.useMemo(()=>ve(a),[a,f]),k=Fe(a.table),S=r.useMemo(()=>(k?.columns??[]).find(l=>l.attributeType==="File"&&l.logicalName===a.fileColumn),[k,a.fileColumn]),ne=l=>i(t=>{const h=new Set(t.dirty);return h.add(l),{...t,dirty:h}}),c=(l,t,h)=>{i(L=>({...L,[l]:t})),h&&ne(h)},I=p[0]?.method??"PATCH",ie=we([["Record id",a.recordId]],[["File column",a.fileColumn]]),re=k?a.recordId?a.fileColumn?a.operation==="upload"&&a.source.kind==="file"&&!a.bodyBase64&&a.source.kind==="file"&&!a.fileName?"Choose a file to upload.":a.headers.some(l=>l.enabled&&!l.name)?"Fix empty header name.":ie:"Pick a file column.":"Pick a source record.":"Pick a target table first.",[de,V]=r.useState(""),ce=async()=>{G(!0);const l=await ia.manageFile(a);D(l),G(!1),R("results"),te(t=>[{id:`r-${Date.now()}`,snapshot:y,modeId:"manage-file",url:x.relativeUrl,method:I,ts:Date.now(),status:l.status,ms:l.ms,rowCount:l.ok?1:0},...t].slice(0,8)),i(t=>({...t,dirty:new Set}))},{allEntities:W}=Ce(),[w,C]=r.useState(d.lastSavedId),[T,B]=r.useState(d.lastSavedHash),y=r.useMemo(()=>Te(a),[a]);Be("manage-file",y,w,T);const ue=r.useMemo(()=>E(y),[y]),_=T===null?!0:ue!==T,he=l=>{C(l.id),B(E(l.state))},K=l=>{if(l.modeId!=="manage-file")return;const t=l.state;if(W.length>0&&t.table&&!W.some(h=>h.logicalName===t.table)){sa(`Can't load "${l.name}": entity \`${t.table}\` isn't available in this environment.`);return}i(Q(t)),C(l.id),B(E(t)),D(null),V(""),N("pipeline")},pe=l=>{const t=ra(l,"manage-file");if(!t)return;const h=w,L=T;K(t),C(h),B(L)},Y=X(he),J=X(K);ze(r.useMemo(()=>a.table?{state:y,modeId:"manage-file",dirty:_,lastSavedId:w,onSaved:Y,onLoadSaved:J}:null,[y,_,w,a.table,Y,J]));const me=r.useMemo(()=>Me()?[Pe.warn("binary-host-unsupported","header","File operations run externally",e.jsxs("span",{children:["PPTB's ",e.jsx("code",{children:"dataverseAPI"})," doesn't expose file column endpoints. Build the request here, then copy a snippet from the ",e.jsx("strong",{children:"Code"})," tab (fetch / curl / C# / PowerShell) and run it from there. Execute will return ",e.jsx("code",{children:"501 Not Implemented"}),"."]}),"pipeline","https://learn.microsoft.com/en-us/power-apps/developer/data-platform/file-column-data")]:[],[]),j=a.operation==="upload"?"UPLOAD":a.operation==="download"?"DOWNLOAD":"DELETE",ge=a.operation==="delete"?"danger":"brand",U=a.operation==="upload"?a.uploadMethod.kind:a.operation==="download"?a.downloadMethod.kind:"simple",be=[{id:"operation",label:"Operation",meta:j.toLowerCase(),items:[{id:"operation",icon:Ae,iconFilled:ae,label:j.charAt(0)+j.slice(1).toLowerCase(),badge:j,badgeAppearance:"tint",badgeColor:ge,dirty:a.dirty.has("operation")}]},{id:"target",label:"Target",meta:k?.displayName??"?",items:[{id:"target",icon:Re,iconFilled:Ne,label:a.recordId?`${k?.displayName??""} (selected)`:"Pick a record",badge:a.recordId?"✓":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")},{id:"column",icon:ee,iconFilled:Z,label:a.fileColumn||"Pick a file column",code:!!a.fileColumn,badge:S?A((S.maxSizeInKB??32768)*1024):null,badgeAppearance:"ghost",dirty:a.dirty.has("column")}]},...a.operation!=="delete"?[{id:"method",label:"Method",meta:U,items:[{id:"method",icon:De,iconFilled:H,label:a.operation==="upload"?"Upload method":"Download method",badge:U,badgeAppearance:"ghost",dirty:a.dirty.has("method")}]}]:[],...a.operation==="upload"?[{id:"payload",label:"Payload",meta:a.fileName||"—",items:[{id:"source",icon:ee,iconFilled:Z,label:"Source",badge:a.source.kind,badgeAppearance:"ghost",dirty:a.dirty.has("source")}]}]:[],{id:"pipe",label:"Pipeline",meta:`${p.length} request${p.length===1?"":"s"}`,items:[{id:"pipeline",icon:Ue,iconFilled:Ie,label:"Generated requests",badge:p.length||null,badgeAppearance:"tint",badgeColor:"brand",dirty:a.dirty.has("pipeline")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(l=>l.enabled).length} active`,items:[{id:"headers",icon:Ee,iconFilled:Le,label:"HTTP headers",badge:a.headers.filter(l=>l.enabled).length||null,dirty:a.dirty.has("headers")}]}];let m;switch(O){case"operation":m=e.jsx(ua,{value:a.operation,onChange:l=>c("operation",l,"operation")});break;case"target":m=e.jsx(Ge,{table:a.table,onTableChange:l=>{i(t=>({...t,table:l,recordId:null,fileColumn:null,dirty:new Set(["target","column"])})),D(null),C(void 0),B(null)},recordId:a.recordId,onRecordChange:(l,t)=>{c("recordId",l,"target"),V(t??"")},group:"binary",sub:"Pick the entity + record that holds the file column."});break;case"column":m=e.jsx(da,{table:a.table,value:a.fileColumn,onChange:l=>c("fileColumn",l,"column")});break;case"method":m=a.operation==="upload"?e.jsx(ha,{value:a.uploadMethod,onChange:l=>c("uploadMethod",l,"method")}):e.jsx(pa,{value:a.downloadMethod,onChange:l=>c("downloadMethod",l,"method")});break;case"source":m=e.jsx($e,{source:a.source,setSource:l=>c("source",l,"source"),fileName:a.fileName,setFileName:l=>c("fileName",l,"source"),fileSize:a.fileSize,setFileSize:l=>c("fileSize",l,"source"),mimeType:a.mimeType,setMimeType:l=>c("mimeType",l,"source"),bodyBase64:a.bodyBase64,setBodyBase64:l=>c("bodyBase64",l,"source"),bodyUrl:a.bodyUrl,setBodyUrl:l=>c("bodyUrl",l,"source"),group:"binary"});break;case"pipeline":m=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx(ma,{state:a,fileCol:S}),e.jsx(qe,{steps:p,title:`${j} pipeline — ${U}`,sub:p.length>1?"Each request fires sequentially.":void 0,sizeAdvisory:a.operation==="upload"?Oe(a.fileSize,S?.maxSizeInKB?S.maxSizeInKB*1024:void 0,"file"):null})]});break;case"headers":m=e.jsx(He,{items:a.headers,setItems:l=>c("headers",l,"headers"),group:"binary"});break}const fe=Ve(a.headers,null),ye={method:I,built:x,...We(p,fe),entityLogical:x.entityLogical};return e.jsx(_e,{sidebar:e.jsx(aa,{type:n,urlPreview:x.relativeNoBase,sections:be,activeNode:O,onSelect:l=>{N(l),R("builder")},recents:oe,onRecentClick:pe}),urlBar:e.jsx(Qe,{method:I,url:x.relativeUrl,executeVerb:a.operation==="upload"?"Upload":a.operation==="download"?"Download":"Delete",executeIcon:a.operation==="upload"?Xe:a.operation==="download"?Ze:ea,disabledReason:re,loading:se,onExecute:ce,advisories:me,onAdvisoryFocus:N}),children:e.jsxs(Ke,{tab:F,onTabChange:R,resultCount:$?.ok?p.length:null,children:[F==="builder"&&m,F==="code"&&e.jsx(Ye,{themeMode:s,inputs:ye}),F==="results"&&e.jsx(Je,{result:$,mode:"single",table:a.table,writeContext:{operation:"manage-file",table:a.table,recordId:a.recordId,recordName:de||null,fileOperation:a.operation,columnName:a.fileColumn??void 0,fileName:a.fileName||void 0}})]})})}function ua({value:s,onChange:n}){const d=oa(),a=[{id:"upload",label:"Upload",sub:"PATCH or message-based upload pipeline.",tone:"brand"},{id:"download",label:"Download",sub:"GET /$value, ranged GET, message pipeline, or SAS URL.",tone:"brand"},{id:"delete",label:"Delete",sub:"DELETE /<set>(<id>)/<col> · clears the column value.",tone:"danger"}];return e.jsxs("div",{children:[e.jsx(q,{icon:ae,title:"Operation",sub:"What to do with the file column — drives the URL bar method + pipeline shape.",group:"binary"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12,maxWidth:960},children:a.map(i=>{const f=s===i.id;return e.jsxs("button",{type:"button",onClick:()=>n(i.id),className:na(d.inlineCard),style:{textAlign:"left",padding:14,cursor:"pointer",background:f?i.tone==="danger"?o.colorPaletteRedBackground2:o.colorBrandBackground2:o.colorNeutralBackground1,border:`1px solid ${f?i.tone==="danger"?o.colorPaletteRedBorderActive:o.colorBrandStroke1:o.colorNeutralStroke2}`,borderRadius:o.borderRadiusMedium},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("strong",{style:{fontSize:13},children:i.label}),f&&e.jsx(ta,{style:{marginLeft:"auto",color:i.tone==="danger"?o.colorPaletteRedForeground1:o.colorBrandForeground1},"aria-label":"Selected"})]}),e.jsx(u,{style:{color:o.colorNeutralForeground2,lineHeight:1.4,marginTop:6,display:"block"},children:i.sub})]},i.id)})})]})}function ha({value:s,onChange:n}){return e.jsxs("div",{children:[e.jsx(q,{icon:H,title:"Upload method",sub:"Per file-column-data — three supported approaches.",group:"binary"}),e.jsxs("div",{style:{maxWidth:760,display:"flex",flexDirection:"column",gap:14},children:[e.jsx(g,{label:"Approach",children:e.jsxs(le,{value:s.kind,onChange:(d,a)=>{switch(a.value){case"single-request":n({kind:"single-request"});break;case"chunked-patch":n({kind:"chunked-patch",chunkSize:s.kind==="chunked-patch"?s.chunkSize:2*1024*1024});break;case"dataverse-messages":n({kind:"dataverse-messages",blockSize:s.kind==="dataverse-messages"?s.blockSize:4*1024*1024});break}},children:[e.jsx(b,{value:"single-request",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Single-request PATCH"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"PATCH /(set)(id)/col"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Fastest for files up to ~128 MB. Body = raw bytes; x-ms-file-name header. No init/commit ceremony."})]})}),e.jsx(b,{value:"chunked-patch",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Chunked PATCH"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"x-ms-transfer-mode: chunked"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Init PATCH returns Location + x-ms-chunk-size. Each chunk = PATCH with Content-Range. Server commits on final chunk."})]})}),e.jsx(b,{value:"dataverse-messages",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Dataverse messages"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"InitializeFileBlocksUpload / UploadBlock / CommitFileBlocksUpload"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Three OData actions. Up to 10 GB. Returns FileId on commit. Use for files > 128 MB or when you need parallel block uploads."})]})})]})}),s.kind==="chunked-patch"&&e.jsxs(g,{label:"Chunk size (bytes)",hint:"Defaults to 2 MB. Server may suggest a different size via x-ms-chunk-size on init.",children:[e.jsx(v,{value:s.chunkSize,min:64*1024,max:64*1024*1024,step:1024*1024,onChange:(d,a)=>n({kind:"chunked-patch",chunkSize:Number(a.value??a.displayValue??s.chunkSize)})}),e.jsxs(u,{style:{marginTop:4,display:"block",color:o.colorNeutralForeground3},children:["≈ ",A(s.chunkSize)," per chunk."]})]}),s.kind==="dataverse-messages"&&e.jsxs(g,{label:"Block size (bytes)",hint:"Default = 4 MB. The docs cap each UploadBlock at 4 MB; smaller is fine.",children:[e.jsx(v,{value:s.blockSize,min:64*1024,max:4*1024*1024,step:1024*1024,onChange:(d,a)=>n({kind:"dataverse-messages",blockSize:Number(a.value??a.displayValue??s.blockSize)})}),e.jsxs(u,{style:{marginTop:4,display:"block",color:o.colorNeutralForeground3},children:["≈ ",A(s.blockSize)," per block."]})]})]})]})}function pa({value:s,onChange:n}){return e.jsxs("div",{children:[e.jsx(q,{icon:H,title:"Download method",sub:"Per file-column-data + getfilesasurl — four supported approaches.",group:"binary"}),e.jsxs("div",{style:{maxWidth:760,display:"flex",flexDirection:"column",gap:14},children:[e.jsx(g,{label:"Approach",children:e.jsxs(le,{value:s.kind,onChange:(d,a)=>{switch(a.value){case"single-request":n({kind:"single-request"});break;case"ranged":n({kind:"ranged",rangeStart:0,rangeEnd:4*1024*1024-1});break;case"dataverse-messages":n({kind:"dataverse-messages",blockSize:4*1024*1024});break;case"sas-url":n({kind:"sas-url"});break}},children:[e.jsx(b,{value:"single-request",label:e.jsxs("span",{children:[e.jsx("strong",{children:"GET /$value"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Stream the entire file in one request. Returns raw bytes. Easy but not great for huge files."})]})}),e.jsx(b,{value:"ranged",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Ranged GET"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"Range: bytes=A-B"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Partial content — server returns 206. Use for resume / parallel download."})]})}),e.jsx(b,{value:"dataverse-messages",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Dataverse messages"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"InitializeFileBlocksDownload + DownloadBlock"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Block-by-block download. Returns FileName + FileSizeInBytes + FileContinuationToken from init."})]})}),e.jsx(b,{value:"sas-url",label:e.jsxs("span",{children:[e.jsx("strong",{children:"GetFileSasUrl"})," ",e.jsx("code",{style:{fontFamily:o.fontFamilyMonospace,fontSize:11},children:"GET /GetFileSasUrl(…)"}),e.jsx(u,{style:{display:"block",color:o.colorNeutralForeground3,marginTop:2},children:"Returns a 1-hour SAS URL that anyone can use to download directly from Azure Storage. Skips Web API roundtrip on the actual download."})]})})]})}),s.kind==="ranged"&&e.jsxs("div",{style:{display:"flex",gap:10,maxWidth:480},children:[e.jsx(g,{label:"Range start (bytes)",children:e.jsx(v,{value:s.rangeStart,min:0,onChange:(d,a)=>n({kind:"ranged",rangeStart:Number(a.value??a.displayValue??0),rangeEnd:s.rangeEnd})})}),e.jsx(g,{label:"Range end (bytes)",children:e.jsx(v,{value:s.rangeEnd,min:0,onChange:(d,a)=>n({kind:"ranged",rangeStart:s.rangeStart,rangeEnd:Number(a.value??a.displayValue??0)})})})]}),s.kind==="dataverse-messages"&&e.jsx(g,{label:"Block size (bytes)",children:e.jsx(v,{value:s.blockSize,min:64*1024,max:4*1024*1024,step:1024*1024,onChange:(d,a)=>n({kind:"dataverse-messages",blockSize:Number(a.value??a.displayValue??s.blockSize)})})}),s.kind==="sas-url"&&e.jsx(z,{layout:"multiline",intent:"info",children:e.jsxs(M,{children:[e.jsx(P,{children:"SAS URL caveats"}),e.jsxs("ul",{style:{margin:"4px 0 0",paddingLeft:18,lineHeight:1.6},children:[e.jsx("li",{children:"Only works for image columns that support full-size images."}),e.jsx("li",{children:"SAS URL valid for 1 hour from generation."}),e.jsx("li",{children:"Does NOT work for environments using BYOK encryption — migrate to CMK first."}),e.jsx("li",{children:"Caller must have access to the record; the resulting URL grants anonymous access for 1 hour."})]})]})})]})]})}function ma({state:s,fileCol:n}){const d=(n?.maxSizeInKB??32768)*1024;if(s.operation==="upload"){const a=s.fileSize>4194304,i=s.fileSize>128*1024*1024;return e.jsx(z,{layout:"multiline",intent:i?"warning":"info",children:e.jsxs(M,{children:[e.jsx(P,{children:"Upload"}),i?e.jsxs(e.Fragment,{children:["File is over ",e.jsx("strong",{children:"128 MB"})," — single-request PATCH won't work. Use the Dataverse messages path which supports up to 10 GB."]}):a?e.jsxs(e.Fragment,{children:["File is over ",e.jsx("strong",{children:"4 MB"})," — chunked PATCH (or Dataverse messages) is recommended; single-request still works up to 128 MB."]}):e.jsxs(e.Fragment,{children:["Small enough for single-request PATCH. Column max: ",A(d),"."]})]})})}return s.operation==="download"?e.jsx(z,{layout:"multiline",intent:"info",children:e.jsxs(M,{children:[e.jsx(P,{children:"Download"}),"Retrieving a file column returns the ",e.jsx("strong",{children:"file id"})," (not bytes) — use the operations below to fetch actual content. GET /$value is the simplest; SAS URL skips the Web API roundtrip when an anonymous browser-side download is fine."]})}):e.jsx(z,{layout:"multiline",intent:"warning",children:e.jsxs(M,{children:[e.jsx(P,{children:"Delete"}),"Clears the file column value + the ",e.jsx("code",{children:"_name"})," companion. The underlying file is removed by Dataverse. Alternative equivalent paths: PATCH the column to null, or call the"," ",e.jsx("code",{children:"DeleteFile"})," action with the column's current FileId."]})})}export{ya as ManageFileMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as ze,b9 as ke,cw as X,l as t,u as Be,cx as Ne,cy as Pe,f as Ce,bc as Re,n as Me,cz as Le,be as Ue,p as H,q as Z,t as Ae,aq as De,ch as Ee,A as e,ci as ie,cj as He,T as $e,v as Oe,cA as q,cB as I,aS as ne,aT as qe,bY as We,cm as _e,L as Ke,z as Ve,H as Ge,co as ee,cp as ae,cq as re,D as Ye,I as Je,cr as Qe,J as Xe,K as Ze,P as ea,R as aa,U as oa,cs as la,ct as ia,cu as na,S as ra,Q as ta,b0 as sa,N as C,O as R,V as $,b8 as te,a2 as i,bq as O,a3 as T,br as se,ah as de,ad as da,ai as ca,aj as oe,b1 as ua,bs as ma}from"./index-XmEQbXiX.js";import{I as pa}from"./BinaryColumnPickers-DYpKoRIO.js";const ga=5*1024*1024;function le(l){if(!l)return 0;const n=l.endsWith("==")?2:l.endsWith("=")?1:0;return Math.max(0,Math.floor(l.length*3/4)-n)}const ba=()=>({table:"",recordId:null,imageColumn:"",operation:"upload",downloadSize:"thumbnail",source:{kind:"file"},fileName:"",fileSize:0,bodyBase64:"",bodyUrl:"",mimeType:"image/png",headers:ta(),dirty:new Set});function wa({themeMode:l}){const n=ze("manage-image"),u=ke("manage-image",X,ba),[a,s]=t.useState(u.state),[b,M]=t.useState(null),m=t.useRef(null),j=t.useCallback(o=>{m.current&&URL.revokeObjectURL(m.current),m.current=o&&o.type.startsWith("image/")&&o.size<=ga?URL.createObjectURL(o):null,M(m.current&&o?{url:m.current,name:o.name}:null)},[]),L=b&&b.name===a.fileName?b.url:null;t.useEffect(()=>()=>{m.current&&URL.revokeObjectURL(m.current)},[]);const{table:z}=Be(a.table||null),[h,v]=t.useState("preview"),[f,U]=t.useState("builder"),[W,A]=t.useState(null),[ce,_]=t.useState(!1),[ue,me]=t.useState([]),w=t.useMemo(()=>Ne(a),[a,z]),y=t.useMemo(()=>Pe(a),[a,z]),F=Ce(a.table),c=t.useMemo(()=>(F?.columns??[]).find(o=>o.attributeType==="Image"&&o.logicalName===a.imageColumn),[F,a.imageColumn]),pe=o=>s(r=>{const g=new Set(r.dirty);return g.add(o),{...r,dirty:g}}),d=(o,r,g)=>{s(E=>({...E,[o]:r})),g&&pe(g)},D=y[0]?.method??"PATCH",ge=Re([["Record id",a.recordId]],[["Image column",a.imageColumn]]),be=F?a.recordId?a.imageColumn?a.operation==="upload"&&a.source.kind==="file"&&!a.fileName?"Pick an image file.":a.operation==="download"&&a.downloadSize==="full"&&!c?.canStoreFullImage?`${a.imageColumn} doesn't store full-size images (canStoreFullImage = false).`:a.headers.some(o=>o.enabled&&!o.name)?"Fix empty header name.":ge:"Pick an image column.":"Pick a source record.":"Pick a target table first.",[he,K]=t.useState(""),ye=async()=>{_(!0);const o=await ua.manageImage(a);A(o),_(!1),U("results"),me(r=>[{id:`r-${Date.now()}`,snapshot:x,modeId:"manage-image",url:w.relativeUrl,method:D,ts:Date.now(),status:o.status,ms:o.ms,rowCount:o.ok?1:0},...r].slice(0,8)),s(r=>({...r,dirty:new Set}))},{allEntities:V}=Me(),[k,B]=t.useState(u.lastSavedId),[N,P]=t.useState(u.lastSavedHash),x=t.useMemo(()=>Le(a),[a]);Ue("manage-image",x,k,N);const fe=t.useMemo(()=>H(x),[x]),G=N===null?!0:fe!==N,xe=o=>{B(o.id),P(H(o.state))},Y=o=>{if(o.modeId!=="manage-image")return;const r=o.state;if(V.length>0&&r.table&&!V.some(g=>g.logicalName===r.table)){sa(`Can't load "${o.name}": entity \`${r.table}\` isn't available in this environment.`);return}s(X(r)),j(null),B(o.id),P(H(r)),A(null),K(""),v("preview")},Se=o=>{const r=ma(o,"manage-image");if(!r)return;const g=k,E=N;Y(r),B(g),P(E)},J=Z(xe),Q=Z(Y);Ae(t.useMemo(()=>a.table?{state:x,modeId:"manage-image",dirty:G,lastSavedId:k,onSaved:J,onLoadSaved:Q}:null,[x,G,k,a.table,J,Q]));const je=t.useMemo(()=>De()?[Ee.warn("binary-host-unsupported","header","Image operations run externally",e.jsxs("span",{children:["PPTB's ",e.jsx("code",{children:"dataverseAPI"})," doesn't expose image column endpoints. Build the request here, then copy a snippet from the ",e.jsx("strong",{children:"Code"})," tab (fetch / curl / C# / PowerShell) and run it from there. Execute will return ",e.jsx("code",{children:"501 Not Implemented"}),"."]}),"preview","https://learn.microsoft.com/en-us/power-apps/developer/data-platform/image-column-data")]:[],[]),S=a.operation==="upload"?"UPLOAD":a.operation==="download"?"DOWNLOAD":"DELETE",ve=a.operation==="delete"?"danger":"brand",we="?",Fe=[{id:"operation",label:"Operation",meta:S.toLowerCase(),items:[{id:"operation",icon:He,iconFilled:ie,label:S.charAt(0)+S.slice(1).toLowerCase(),badge:S,badgeAppearance:"tint",badgeColor:ve,dirty:a.dirty.has("operation")}]},{id:"target",label:"Target",meta:F?.displayName??"?",items:[{id:"target",icon:Oe,iconFilled:$e,label:a.recordId?`${F?.displayName??""} (selected)`:"Pick a record",badge:a.recordId?"✓":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")},{id:"column",icon:I,iconFilled:q,label:a.imageColumn||"Pick an image column",code:!!a.imageColumn,badge:c?.isPrimaryImage?"primary":c?.canStoreFullImage?"full":"thumb",badgeAppearance:"tint",badgeColor:c?.canStoreFullImage?"success":"brand",dirty:a.dirty.has("column")}]},...c?[{id:"deriv",label:"Derivatives",meta:"3 companion columns",items:[{id:"d1",icon:I,label:`${c.logicalName}id`,code:!0,badge:"guid",badgeAppearance:"ghost"},{id:"d2",icon:I,label:`${c.logicalName}_Timestamp`,code:!0,badge:"bigint",badgeAppearance:"ghost"},{id:"d3",icon:I,label:`${c.logicalName}_URL`,code:!0,badge:"url",badgeAppearance:"ghost"}]}]:[],...a.operation==="upload"?[{id:"payload",label:"Payload",meta:a.fileName||"—",items:[{id:"source",icon:I,iconFilled:q,label:"Source",badge:a.source.kind,badgeAppearance:"ghost",dirty:a.dirty.has("source")}]}]:[],...a.operation==="download"?[{id:"options",label:"Options",meta:a.downloadSize,items:[{id:"options",icon:qe,iconFilled:ne,label:"Download size",badge:a.downloadSize,badgeAppearance:"tint",badgeColor:"brand",dirty:a.dirty.has("options")}]}]:[],{id:"pipe",label:"Pipeline",meta:`${y.length} request${y.length===1?"":"s"}`,items:[{id:"pipeline",icon:_e,iconFilled:We,label:"Generated requests",badge:y.length||null,badgeAppearance:"tint",badgeColor:"brand",dirty:a.dirty.has("pipeline")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(o=>o.enabled).length} active`,items:[{id:"headers",icon:Ve,iconFilled:Ke,label:"HTTP headers",badge:a.headers.filter(o=>o.enabled).length||null,dirty:a.dirty.has("headers")}]}];let p;switch(h){case"operation":p=e.jsx(ya,{value:a.operation,onChange:o=>d("operation",o,"operation")});break;case"target":p=e.jsx(Ye,{table:a.table,onTableChange:o=>{s(r=>({...r,table:o,recordId:null,imageColumn:null,dirty:new Set(["target","column"])})),A(null),B(void 0),P(null)},recordId:a.recordId,onRecordChange:(o,r)=>{d("recordId",o,"target"),K(r??"")},group:"binary",sub:"Pick the entity + record that holds the image column."});break;case"column":p=e.jsx(pa,{table:a.table,value:a.imageColumn,onChange:o=>d("imageColumn",o,"column")});break;case"source":p=e.jsx(re,{source:a.source,setSource:o=>d("source",o,"source"),fileName:a.fileName,setFileName:o=>d("fileName",o,"source"),fileSize:a.fileSize??0,setFileSize:o=>d("fileSize",o,"source"),mimeType:a.mimeType,setMimeType:o=>d("mimeType",o,"source"),bodyBase64:a.bodyBase64,setBodyBase64:o=>d("bodyBase64",o,"source"),bodyUrl:a.bodyUrl,setBodyUrl:o=>d("bodyUrl",o,"source"),accept:"image/png,image/jpeg,image/gif,image/bmp,image/tiff",group:"binary",onFile:j});break;case"options":p=e.jsx(fa,{downloadSize:a.downloadSize,setDownloadSize:o=>d("downloadSize",o,"options"),canStoreFullImage:c?.canStoreFullImage??!1});break;case"preview":p=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx(xa,{state:a,imageCol:c}),e.jsx(ha,{state:a,imageCol:c,initials:we,setSource:o=>d("source",o,"source"),setBodyBase64:o=>d("bodyBase64",o,"source"),setFileName:o=>d("fileName",o,"source"),setFileSize:o=>d("fileSize",o,"source"),setMimeType:o=>d("mimeType",o,"source"),previewUrl:L,onFile:j}),e.jsx(ee,{steps:y,title:`${S} pipeline`,sizeAdvisory:a.operation==="upload"?ae(a.fileSize||le(a.bodyBase64),c?.maxSizeInKB?c.maxSizeInKB*1024:void 0,"image"):null})]});break;case"pipeline":p=e.jsx(ee,{steps:y,title:`${S} pipeline`,sizeAdvisory:a.operation==="upload"?ae(a.fileSize||le(a.bodyBase64),c?.maxSizeInKB?c.maxSizeInKB*1024:void 0,"image"):null});break;case"headers":p=e.jsx(Ge,{items:a.headers,setItems:o=>d("headers",o,"headers"),group:"binary"});break}const Ie=Je(a.headers,null),Te={method:D,built:w,...Qe(y,Ie),entityLogical:w.entityLogical};return e.jsx(Xe,{sidebar:e.jsx(ra,{type:n,urlPreview:w.relativeNoBase,sections:Fe,activeNode:h,onSelect:o=>{v(o),U("builder")},recents:ue,onRecentClick:Se}),urlBar:e.jsx(oa,{method:D,url:w.relativeUrl,executeVerb:a.operation==="upload"?"Upload":a.operation==="download"?"Download":"Delete",executeIcon:a.operation==="upload"?la:a.operation==="download"?ia:na,disabledReason:be,loading:ce,onExecute:ye,advisories:je,onAdvisoryFocus:v}),children:e.jsxs(Ze,{tab:f,onTabChange:U,resultCount:W?.ok?1:null,children:[f==="builder"&&p,f==="code"&&e.jsx(ea,{themeMode:l,inputs:Te}),f==="results"&&e.jsx(aa,{result:W,mode:"single",table:a.table,writeContext:{operation:"manage-image",table:a.table,recordId:a.recordId,recordName:he||null,fileOperation:a.operation,columnName:a.imageColumn??void 0,fileName:a.fileName||void 0}})]})})}function ha({state:l,imageCol:n,initials:u,setSource:a,setBodyBase64:s,setFileName:b,setFileSize:M,setMimeType:m,previewUrl:j,onFile:L}){const z=te(),h=l.source.kind==="file"?j:l.source.kind==="base64"&&l.bodyBase64?`data:${l.mimeType};base64,${l.bodyBase64}`:null,v=n?.isPrimaryImage&&!n?.canStoreFullImage;return e.jsxs("div",{className:se(z.inlineCard),style:{padding:14,maxWidth:880},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx(q,{style:{color:i.colorBrandForeground1}}),e.jsx("strong",{style:{fontSize:13},children:"Preview · Source"}),e.jsx(O,{appearance:"tint",color:"brand",children:n?.isPrimaryImage?"primary image":"custom image column"}),v&&e.jsx(O,{appearance:"ghost",children:"144×144 only"}),n?.canStoreFullImage&&e.jsx(O,{appearance:"tint",color:"success",children:"full-size enabled"})]}),e.jsxs("div",{style:{display:"flex",gap:20,alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsxs(T,{style:{color:i.colorNeutralForeground3,display:"block",marginBottom:4},children:[l.operation==="upload"?"Preview":l.downloadSize==="full"?"Full-size":"Thumbnail"," ","· 144×144"]}),e.jsx("div",{style:{width:144,height:144,background:h?`url("${h}") center/cover`:i.colorNeutralBackground3,borderRadius:i.borderRadiusMedium,display:"flex",alignItems:"center",justifyContent:"center",color:h?"#fff":i.colorNeutralForeground3,fontWeight:700,fontSize:40,border:`1px solid ${i.colorNeutralStroke2}`},children:!h&&u}),(h||l.source.kind==="file"&&l.fileName)&&e.jsxs(T,{style:{color:i.colorNeutralForeground3,display:"block",marginTop:4},children:[l.fileName," · ",l.mimeType]})]}),l.operation==="upload"&&e.jsx("div",{style:{flex:1},children:e.jsx(re,{source:l.source,setSource:a,fileName:l.fileName,setFileName:b,fileSize:l.fileSize??0,setFileSize:M,mimeType:l.mimeType,setMimeType:f=>m(f),bodyBase64:l.bodyBase64,setBodyBase64:s,bodyUrl:l.bodyUrl,setBodyUrl:()=>{},accept:"image/png,image/jpeg,image/gif,image/bmp,image/tiff",group:"binary",onFile:L})}),l.operation!=="upload"&&e.jsxs("div",{style:{flex:1,fontSize:11,color:i.colorNeutralForeground3,lineHeight:1.6},children:[l.operation==="download"&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{style:{color:i.colorNeutralForeground2},children:"Download:"})," server returns the"," ",l.downloadSize==="full"?"original full-size":"auto-cropped 144×144 thumbnail"," ","as raw bytes. The Content-Type matches the stored image's MIME type (one of image/png · image/jpeg · image/gif · image/bmp · image/tiff)."]}),l.operation==="delete"&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{style:{color:i.colorNeutralForeground2},children:"Delete:"})," clears the image data + companion columns (",e.jsxs("code",{style:{fontFamily:i.fontFamilyMonospace},children:[n?.logicalName,"id"]}),", ",e.jsx("code",{style:{fontFamily:i.fontFamilyMonospace},children:"_Timestamp"}),","," ",e.jsx("code",{style:{fontFamily:i.fontFamilyMonospace},children:"_URL"}),"). Equivalent forms: PATCH set null, PUT /col with body ",e.jsx("code",{children:'{"value":null}'}),", or DELETE /col (shown)."]})]})]})]})}function ya({value:l,onChange:n}){const u=te(),a=[{id:"upload",label:"Upload",sub:"PATCH /<set>(<id>) with body {col: <base64>}.",tone:"brand"},{id:"download",label:"Download",sub:"GET /<set>(<id>)/<col>/$value (?size=full for full).",tone:"brand"},{id:"delete",label:"Delete",sub:"DELETE / PATCH null / PUT /col body=null — three equivalents.",tone:"danger"}];return e.jsxs("div",{children:[e.jsx(de,{icon:ie,title:"Operation",group:"binary"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12,maxWidth:960},children:a.map(s=>{const b=l===s.id;return e.jsxs("button",{type:"button",onClick:()=>n(s.id),className:se(u.inlineCard),style:{textAlign:"left",padding:14,cursor:"pointer",background:b?s.tone==="danger"?i.colorPaletteRedBackground2:i.colorBrandBackground2:i.colorNeutralBackground1,border:`1px solid ${b?s.tone==="danger"?i.colorPaletteRedBorderActive:i.colorBrandStroke1:i.colorNeutralStroke2}`,borderRadius:i.borderRadiusMedium},children:[e.jsx("strong",{style:{fontSize:13,display:"block"},children:s.label}),e.jsx(T,{style:{color:i.colorNeutralForeground2,lineHeight:1.4,marginTop:6,display:"block"},children:s.sub})]},s.id)})})]})}function fa({downloadSize:l,setDownloadSize:n,canStoreFullImage:u}){return e.jsxs("div",{children:[e.jsx(de,{icon:ne,title:"Download options",sub:"Image columns can store both thumbnail + full-size when CanStoreFullImage is true.",group:"binary"}),e.jsx("div",{style:{maxWidth:720},children:e.jsx(da,{label:"Size",children:e.jsxs(ca,{value:l,onChange:(a,s)=>n(s.value),children:[e.jsx(oe,{value:"thumbnail",label:e.jsxs("span",{children:[e.jsx("strong",{children:"Thumbnail (144×144)"}),e.jsx(T,{style:{display:"block",color:i.colorNeutralForeground3,marginTop:2},children:"Default for all image columns. Center-cropped square."})]})}),e.jsx(oe,{value:"full",disabled:!u,label:e.jsxs("span",{children:[e.jsx("strong",{children:"Full-size"})," ",e.jsx("code",{style:{fontFamily:i.fontFamilyMonospace,fontSize:11},children:"?size=full"}),e.jsxs(T,{style:{display:"block",color:i.colorNeutralForeground3,marginTop:2},children:["Only available when the column has CanStoreFullImage = true. Server returns 204 if not configured.",!u&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("span",{style:{color:i.colorPaletteRedForeground1},children:"this column doesn't support full-size"})]})]})]})})]})})})]})}function xa({state:l,imageCol:n}){return n?l.operation==="upload"?e.jsx(C,{layout:"multiline",intent:"info",children:e.jsxs(R,{children:[e.jsx($,{children:n.isPrimaryImage?"Primary image — thumbnail only":"Custom image column"}),n.isPrimaryImage?e.jsxs(e.Fragment,{children:[e.jsx("code",{children:n.logicalName})," is the table's primary image (auto-cropped 144×144). Full-size data is discarded. To store full-resolution images, create a custom image column with ",e.jsx("code",{children:"CanStoreFullImage = true"}),"."]}):n.canStoreFullImage?e.jsxs(e.Fragment,{children:[e.jsx("code",{children:n.logicalName})," supports full-size (max"," ",((n.maxSizeInKB??10240)/1024).toFixed(0)," MB). Upload via PATCH; for files > 4 MB use the file-column chunked upload path on the underlying file storage."]}):e.jsxs(e.Fragment,{children:[e.jsx("code",{children:n.logicalName})," stores thumbnail only (CanStoreFullImage = false). Full-size won't be retained."]})]})}):l.operation==="download"?e.jsx(C,{layout:"multiline",intent:"info",children:e.jsxs(R,{children:[e.jsx($,{children:"Download"}),"GET /$value returns the"," ",l.downloadSize==="full"?"full-size original":"144×144 thumbnail",". Image companion columns (",e.jsxs("code",{children:[n.logicalName,"_URL"]})," etc.) let you compose a download URL for browser-side use."]})}):e.jsx(C,{layout:"multiline",intent:"warning",children:e.jsxs(R,{children:[e.jsx($,{children:"Delete"}),"Clears ",e.jsx("code",{children:n.logicalName})," + its companion columns (id / _Timestamp / _URL). Three equivalent paths per docs: DELETE /col (shown), PATCH set null, or PUT /col with body"," ",e.jsx("code",{children:'{"value":null}'}),"."]})}):e.jsx(C,{layout:"multiline",intent:"info",children:e.jsx(R,{children:"Pick an image column on the left to see operation-specific guidance."})})}export{wa as ManageImageMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as P,l as b,bt as et,bu as xe,ap as ce,bv as tt,A as e,N as E,O as $,ah as G,bw as J,ae,bx as rt,aL as Fe,Y as at,by as st,bz as it,bq as Q,a2 as n,b8 as Ce,a3 as M,ai as nt,aj as te,aE as Ie,br as ot,bA as lt,bB as se,bn as ie,b5 as ne,bC as dt,_ as oe,ak as ct,al as ut,bD as pt,bE as gt,k as bt,b9 as ht,bF as je,u as ft,n as De,bG as mt,bH as yt,bI as xt,bJ as jt,ar as St,as as vt,at as kt,au as Tt,bK as Nt,be as wt,p as re,q as Se,t as Ft,bL as Pe,bM as Ct,bN as ve,aS as Me,aT as It,L as Dt,z as Pt,aB as le,aC as Mt,aD as Lt,H as Rt,I as ke,J as Bt,K as At,P as Ot,R as zt,U as Et,S as $t,Q as Vt,aN as Ut,bO as Ht,b0 as _t,V as Le,ad as Re,b6 as Gt,T as Wt,b1 as qt,bs as Kt,bP as Jt}from"./index-XmEQbXiX.js";const Qt=new Set(["createdon","modifiedon","createdby","modifiedby","createdonbehalfby","modifiedonbehalfby","versionnumber","importsequencenumber","overriddencreatedon","utcconversiontimezonecode","timezoneruleversionnumber","statecode","statuscode"]),Xt=s=>Qt.has(s.logicalName)||s.attributeType==="File"||s.attributeType==="Image"||s.attributeType==="Uniqueidentifier"&&s.isPrimaryKey===!0;function Yt(s){const{table:a,target:i,sub:t,fieldChoices:d,customValues:c,setFieldChoice:p,setCustomValue:o}=s,u=P(a),[h,S]=b.useState(""),[k,C]=b.useState(!0),T=b.useMemo(()=>!u||!i||!t?[]:u.columns.filter(x=>!Xt(x)&&x.isValidForUpdate!==!1&&!et(x)).map(x=>{const v=xe(i,x),N=xe(t,x),V=v==null||v==="",I=N==null||N==="";let F;return V&&I?F="both-empty":V&&!I?F="auto-fill":!V&&I?F="sub-empty":ce(x)?F=tt(v,N)?"same":"differs":F=String(v)===String(N)?"same":"differs",{col:x,targetVal:v,subVal:N,state:F}}),[u,i,t]),L=b.useMemo(()=>{let m=T;if(k&&(m=m.filter(y=>y.state==="differs"||y.state==="auto-fill")),h){const y=h.toLowerCase();m=m.filter(x=>x.col.displayName.toLowerCase().includes(y)||x.col.logicalName.toLowerCase().includes(y))}return m},[T,k,h]),w=b.useMemo(()=>{const m=Object.values(d).filter(v=>v!=="target").length,y=T.filter(v=>v.state==="differs").length,x=T.filter(v=>v.state==="auto-fill").length;return{overrides:m,differs:y,autoFill:x}},[d,T]);return u?!i||!t?e.jsxs("div",{children:[e.jsx(G,{icon:J,title:"Field comparison",sub:"Pick both Target and Subordinate to see a side-by-side diff.",group:"write"}),e.jsx(E,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsx($,{children:!i&&!t?"Pick a Target (the record that survives) and a Subordinate (the duplicate to merge away) to start.":i?"Pick a Subordinate record on the left rail.":"Pick a Target record on the left rail."})})]}):e.jsxs("div",{children:[e.jsxs(G,{icon:J,title:"Field comparison",sub:e.jsxs("span",{children:["For each differing field, pick what the merged row should carry — the Target's value, the Subordinate's value, or your own."," ",e.jsx("strong",{children:"Empty Target fields get auto-filled"})," from the Subordinate by the server."]}),group:"write",children:[e.jsx(ae,{contentBefore:e.jsx(rt,{}),"aria-label":"Filter fields",placeholder:"Filter fields…",value:h,onChange:(m,y)=>S(y.value),size:"small",style:{width:220}}),e.jsx(Fe,{content:k?"Showing only differing / auto-fill rows":"Showing every column",relationship:"description",children:e.jsx(at,{size:"small",appearance:k?"primary":"outline",icon:k?e.jsx(st,{}):e.jsx(it,{}),onClick:()=>C(m=>!m),children:k?"Diff only":"All fields"})}),e.jsxs(Q,{appearance:"tint",color:w.overrides>0?"brand":"subtle",children:[w.overrides," override",w.overrides===1?"":"s"]}),e.jsxs(Q,{appearance:"ghost",children:[w.differs," differ · ",w.autoFill," auto-fill"]})]}),e.jsx("div",{style:{maxWidth:1200,overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(q,{style:{width:"20%"},children:"Field"}),e.jsx(q,{tone:"target",children:"Target (survives)"}),e.jsx(q,{tone:"sub",children:"Subordinate"}),e.jsx(q,{style:{width:"34%"},children:"Final value"})]})}),e.jsxs("tbody",{children:[L.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,style:{padding:"24px 8px",textAlign:"center",color:n.colorNeutralForeground3,fontStyle:"italic"},children:k?'No differing fields. Toggle "All fields" to see the full row.':"No fields match the search."})}),L.map(m=>e.jsx(Zt,{tbl:u,row:m,choice:d[m.col.logicalName]??"target",customValue:c[m.col.logicalName],onChoice:y=>p(m.col.logicalName,y),onCustom:y=>o(m.col.logicalName,y)},m.col.logicalName))]})]})})]}):e.jsx(E,{layout:"multiline",intent:"error",children:e.jsxs($,{children:["Unknown table ",e.jsx("code",{children:a}),"."]})})}function Zt({tbl:s,row:a,choice:i,customValue:t,onChoice:d,onCustom:c}){const p=Ce(),{col:o,targetVal:u,subVal:h,state:S}=a,k=S==="differs",C=S==="auto-fill",T=!(h==null||h==="");return e.jsxs("tr",{children:[e.jsx(K,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontWeight:500,color:n.colorNeutralForeground1,fontSize:12},children:o.displayName}),e.jsxs(M,{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace,fontSize:10},children:[o.logicalName," ·"," ",e.jsx("span",{style:{color:n.colorBrandForeground2},children:o.attributeType})]}),C&&e.jsx(Fe,{content:"Target is empty — server will auto-fill from Subordinate. No override needed.",relationship:"description",children:e.jsx(Q,{appearance:"tint",color:"success",size:"small",style:{alignSelf:"flex-start"},children:"auto-fill"})})]})}),e.jsx(K,{tone:"target",children:e.jsx(Te,{col:o,value:u,tbl:s})}),e.jsx(K,{tone:"sub",children:e.jsx(Te,{col:o,value:h,tbl:s})}),e.jsx(K,{children:e.jsxs("div",{className:ot(p.inlineCard),style:{padding:"6px 8px"},children:[e.jsxs(nt,{layout:"horizontal",value:i,onChange:(L,w)=>d(w.value),children:[e.jsx(te,{value:"target",label:e.jsxs("span",{style:{fontSize:11},children:["Target",!k&&!C&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · default"})]})}),e.jsx(te,{value:"subordinate",disabled:!T,label:e.jsxs("span",{style:{fontSize:11},children:["Subordinate",!T&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · empty"})]})}),e.jsx(te,{value:"custom",label:e.jsx("span",{style:{fontSize:11},children:"Custom"})})]}),i==="custom"&&e.jsx("div",{style:{marginTop:6},children:e.jsx(er,{col:o,value:t,onChange:c,fallback:typeof u=="object"?"":String(u??""),parentTable:s.logicalName})}),i==="subordinate"&&e.jsxs("div",{style:{marginTop:6,display:"flex",alignItems:"center",gap:6},children:[e.jsx(Ie,{style:{width:14,height:14,color:n.colorBrandForeground1}}),e.jsxs(M,{style:{color:n.colorBrandForeground2,fontWeight:500},children:["Will overwrite Target with: ",e.jsx("strong",{children:Be(o,h)})]})]})]})})]})}function q({children:s,style:a,tone:i}){const t=i==="target"?{background:"rgba(31,127,56,.08)",color:n.colorPaletteGreenForeground1}:i==="sub"?{background:"rgba(242,176,80,.08)",color:n.colorPaletteDarkOrangeForeground1}:{};return e.jsx("th",{style:{textAlign:"left",padding:"8px 10px",fontSize:11,fontWeight:600,color:n.colorNeutralForeground2,borderBottom:`2px solid ${n.colorNeutralStroke2}`,whiteSpace:"nowrap",...t,...a},children:s})}function K({children:s,tone:a}){const i=a==="target"?{background:"rgba(31,127,56,.025)",borderLeft:`2px solid ${n.colorPaletteGreenBorderActive}`}:a==="sub"?{background:"rgba(242,176,80,.025)",borderLeft:`2px solid ${n.colorPaletteDarkOrangeBorderActive}`}:{};return e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"top",borderBottom:`1px solid ${n.colorNeutralStroke3}`,fontSize:12,...i},children:s})}function Te({col:s,value:a,tbl:i}){if(a==null||a==="")return e.jsx("span",{style:{color:n.colorNeutralForeground3,fontStyle:"italic",fontSize:11},children:"(empty)"});const t=Be(s,a);return e.jsx("span",{style:{fontFamily:s.attributeType==="Uniqueidentifier"||ce(s)&&!a.name?n.fontFamilyMonospace:n.fontFamilyBase,fontSize:12,color:n.colorNeutralForeground1,wordBreak:"break-word"},children:t})}function Be(s,a){if(a==null||a==="")return"(empty)";if(s.attributeType==="Boolean")return a===!0||a==="1"||a===1?s.trueOption.label:s.falseOption.label;if(ce(s)&&typeof a=="object"&&"id"in a)return pt(a);const i=se(s);if(i){const t=Number(a);if(Number.isFinite(t)){const d=i.find(c=>c.value===t);if(d)return`${d.label} · ${t}`}if(s.attributeType==="MultiSelectPicklist"&&typeof a=="string")return a.split(",").map(d=>{const c=i.find(p=>String(p.value)===d);return c?c.label:d}).join(", ")}if(s.attributeType==="Money"){const t=Number(a);if(Number.isFinite(t))return t.toLocaleString(void 0,{style:"currency",currency:"USD"})}return s.attributeType==="DateTime"&&typeof a=="string"?gt(a,s):String(a)}function er({col:s,value:a,onChange:i,fallback:t,parentTable:d}){switch(lt(d,s.logicalName),s.attributeType){case"Memo":return e.jsx(ut,{"aria-label":`${s.displayName} (custom value)`,rows:2,size:"small",value:a??t,onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});case"Integer":case"BigInt":case"Decimal":case"Double":case"Money":return e.jsx(ct,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:Number(a??0),onChange:(c,p)=>{const o=p.value??Number(p.displayValue??0);Number.isFinite(o)&&i(o)}});case"Boolean":return e.jsx(oe,{checked:a===!0,onChange:(c,p)=>i(p.checked),label:a===!0?s.trueOption.label:s.falseOption.label});case"Picklist":case"State":case"Status":case"EntityName":{const c=se(s)??[],p=c.find(o=>o.value===a);return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:p?.label??(a!=null?String(a):""),selectedOptions:a!=null?[String(a)]:[],onOptionSelect:(o,u)=>u.optionValue&&i(Number(u.optionValue)),placeholder:"Pick a value…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"Lookup":case"Customer":case"Owner":return e.jsx(dt,{col:s,value:a,onChange:i});case"MultiSelectPicklist":{const c=se(s)??[],p=Array.isArray(a)?a:typeof a=="string"&&a?a.split(",").map(o=>Number(o.trim())).filter(o=>Number.isFinite(o)):[];return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",multiselect:!0,value:p.map(o=>c.find(u=>u.value===o)?.label??String(o)).join(", "),selectedOptions:p.map(String),onOptionSelect:(o,u)=>{const h=(u.selectedOptions??[]).map(S=>Number(S)).filter(S=>Number.isFinite(S));i(h)},placeholder:"Pick one or more…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"DateTime":return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",type:s.format==="DateOnly"?"date":"datetime-local",value:typeof a=="string"?a.slice(0,16):"",onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});default:return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:a??t,onChange:(c,p)=>i(p.value)})}}const de=["account","contact","lead","incident"],Ae="account, contact, lead, and incident",tr=s=>de.includes(s),rr=()=>({table:"",targetId:null,subordinateId:null,fieldChoices:{},customValues:{},performParentingChecks:!0,suppressDuplicateDetection:!1,bypass:Ut(),headers:Vt(),dirty:new Set,targetSnapshot:null,subordinateSnapshot:null}),z=Ht;function dr({themeMode:s}){const a=bt("merge"),i=ht("merge",je,rr),[t,d]=b.useState(i.state),{table:c}=ft(t.table||null),{allEntities:p}=De(),[o,u]=b.useState("target"),[h,S]=b.useState("builder"),[k,C]=b.useState(null),[T,L]=b.useState(!1),[w,m]=b.useState([]),[y,x]=b.useState(i.lastSavedId),[v,N]=b.useState(i.lastSavedHash),[V,I]=b.useState(!1),[F,X]=b.useState(!1),j=P(t.table),Y=b.useMemo(()=>{const r=t.subordinateSnapshot;if(!j||!r)return[];const g=new Set;for(const[l,f]of Object.entries(t.fieldChoices)){if(f!=="subordinate")continue;const A=j.columns.find(Ze=>Ze.logicalName===l),O=A&&mt(r,A)?.targetEntity;O&&g.add(O)}return[...g].sort()},[j,t.subordinateSnapshot,t.fieldChoices]),Oe=Y.join("|"),[ze,Ee]=b.useState([]);b.useEffect(()=>{for(const r of Y)P(r)||yt.getTable(r).catch(()=>{}).then(g=>{g||Ee(l=>l.includes(r)?l:[...l,r])})},[Oe]);const W=Y.filter(r=>!P(r)),ue=W.filter(r=>ze.includes(r)),U=b.useMemo(()=>xt(t),[t,c]),$e=W.join("|"),Ve=b.useMemo(()=>jt(t),[t,c,$e]);b.useEffect(()=>{let r=!1;if(!t.table||!t.targetId||!j||!z(t.targetId)){d(l=>({...l,targetSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;I(!0);const g=`/${j.entitySetName}(${t.targetId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,targetSnapshot:A})),I(!1)}).catch(()=>{r||(d(l=>({...l,targetSnapshot:null})),I(!1))}),()=>{r=!0}},[t.table,t.targetId,j]),b.useEffect(()=>{let r=!1;if(!t.table||!t.subordinateId||!j||!z(t.subordinateId)){d(l=>({...l,subordinateSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;X(!0);const g=`/${j.entitySetName}(${t.subordinateId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,subordinateSnapshot:A})),X(!1)}).catch(()=>{r||(d(l=>({...l,subordinateSnapshot:null})),X(!1))}),()=>{r=!0}},[t.table,t.subordinateId,j]);const pe=r=>d(g=>{const l=new Set(g.dirty);return l.add(r),{...g,dirty:l}}),R=(r,g,l)=>{d(f=>({...f,[r]:g})),l&&pe(l)},Ue=(r,g)=>{d(l=>{const f={...l.fieldChoices};return g==="target"?delete f[r]:f[r]=g,{...l,fieldChoices:f,dirty:new Set(l.dirty).add("fielddiff")}})},He=(r,g)=>{d(l=>({...l,customValues:{...l.customValues,[r]:g},dirty:new Set(l.dirty).add("fielddiff")}))},Z=t.targetSnapshot,ee=t.subordinateSnapshot,H=Object.values(t.fieldChoices).filter(r=>r!=="target").length,_e=j?tr(j.logicalName)?t.targetId?z(t.targetId)?t.subordinateId?z(t.subordinateId)?t.targetId===t.subordinateId?"Target and Subordinate must be different records.":t.headers.some(r=>r.enabled&&!r.name)?"Fix empty header name.":ue.length>0?`Couldn't load metadata for ${ue.join(", ")}, so a lookup kept from the Subordinate can’t be bound. Pick Target or Custom for it instead.`:W.length>0?`Loading metadata for ${W.join(", ")} to bind the lookups kept from the Subordinate…`:null:"Subordinate record id is not a valid GUID.":"Pick a Subordinate record (the loser).":"Target record id is not a valid GUID.":"Pick a Target record (the winner).":`Merge is only supported for ${Ae}.`:"Pick a target table first.",Ge=async()=>{L(!0);const r=await qt.merge(t,ke(ge,null));C(r),L(!1),S("results"),m(g=>[{id:`r-${Date.now()}`,snapshot:B,modeId:"merge",url:U.relativeUrl,method:"POST",ts:Date.now(),status:r.status,ms:r.ms,rowCount:r.ok?1:0},...g].slice(0,8)),d(g=>({...g,dirty:new Set}))},ge=b.useMemo(()=>{let r=[...t.headers];return t.suppressDuplicateDetection&&r.push({id:"__sup-dupe",name:"MSCRM.SuppressDuplicateDetection",value:"true",enabled:!0,builtin:!0,hint:"Skips duplicate detection rules when applying UpdateContent overrides."}),r=St(r,t.bypass),r},[t.headers,t.suppressDuplicateDetection,t.bypass]),be=b.useMemo(()=>{const r=[...vt(t.bypass,"bypass"),...kt({op:"merge",bypass:t.bypass})];return t.targetId&&!z(t.targetId)&&r.push({id:"merge-bad-target-guid",severity:"error",source:"validation",focusNode:"target",title:"Invalid Target record id",body:`"${t.targetId}" isn't a valid GUID. The merge will fail at the wire.`}),t.subordinateId&&!z(t.subordinateId)&&r.push({id:"merge-bad-sub-guid",severity:"error",source:"validation",focusNode:"subordinate",title:"Invalid Subordinate record id",body:`"${t.subordinateId}" isn't a valid GUID. The merge will fail at the wire.`}),r},[t.bypass,t.targetId,t.subordinateId]),We=Tt(be),B=b.useMemo(()=>Nt(t),[t]);wt("merge",B,y,v);const qe=b.useMemo(()=>re(B),[B]),he=v===null?!0:qe!==v,Ke=r=>{x(r.id),N(re(r.state))},fe=r=>{if(r.modeId!=="merge")return;const g=r.state;if(p.length>0&&!p.some(l=>l.logicalName===g.table)){_t(`Can't load "${r.name}": entity \`${g.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}d(je(g)),x(r.id),N(re(g)),C(null),u("target")},Je=r=>{const g=Kt(r,"merge");if(!g)return;const l=y,f=v;fe(g),x(l),N(f)},me=Se(Ke),ye=Se(fe);Ft(b.useMemo(()=>t.table?{state:B,modeId:"merge",dirty:he,lastSavedId:y,onSaved:me,onLoadSaved:ye}:null,[B,he,y,t.table,me,ye]));const Qe=[{id:"target",label:"Target",meta:j?.displayName??"Pick a table",items:[{id:"target",icon:Ct,iconFilled:Pe,label:"Master (survives)",badge:t.targetId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("target")||t.dirty.has("entity")}]},{id:"subordinate-section",label:"Subordinate",meta:t.subordinateId?"will be deactivated":"pick a record",items:[{id:"subordinate",icon:ve,iconFilled:J,label:"Subordinate record",badge:t.subordinateId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("subordinate")}]},{id:"override",label:"Override fields",meta:`${H} override${H===1?"":"s"}`,items:[{id:"fielddiff",icon:ve,iconFilled:J,label:"Field comparison",badge:H||null,badgeAppearance:"tint",badgeColor:H>0?"brand":"subtle",dirty:t.dirty.has("fielddiff")}]},{id:"settings",label:"Settings",meta:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)==0?"defaults":`${(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)} set`,items:[{id:"options",icon:It,iconFilled:Me,label:"Merge options",badge:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)||null,badgeAppearance:"ghost",dirty:t.dirty.has("options")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(r=>r.enabled).length} active`,items:[{id:"headers",icon:Pt,iconFilled:Dt,label:"HTTP headers",badge:t.headers.filter(r=>r.enabled).length||null,dirty:t.dirty.has("headers")},{id:"bypass",icon:le,iconFilled:le,label:"Bypass logic",badge:Mt(t.bypass),badgeAppearance:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"tint":"ghost",badgeColor:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"warning":"subtle",dirty:t.dirty.has("bypass")}]}];let D;switch(o){case"target":D=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx(ir,{state:t,setState:d,markDirty:pe,onEntityChange:()=>{x(void 0),N(null)}}),e.jsx(we,{title:"Master record",sub:"The record that keeps its identity. Subordinate is merged into it.",table:t.table,selectedId:t.targetId,onPick:r=>R("targetId",r,"target")})]});break;case"subordinate":D=e.jsx(we,{title:"Subordinate (deactivated)",sub:"The duplicate to merge away. Its relationships re-parent to the Target; the row gets statecode=Inactive.",table:t.table,selectedId:t.subordinateId,onPick:r=>R("subordinateId",r,"subordinate"),conflictWith:t.targetId});break;case"fielddiff":D=e.jsxs("div",{children:[e.jsx(ar,{overrideCount:H,subordinateName:_(j,ee??void 0)}),e.jsx(sr,{table:t.table,target:Z??void 0,subordinate:ee??void 0,targetLoading:V,subordinateLoading:F}),e.jsx(Yt,{table:t.table,target:t.targetSnapshot??null,sub:t.subordinateSnapshot??null,fieldChoices:t.fieldChoices,customValues:t.customValues,setFieldChoice:Ue,setCustomValue:He})]});break;case"options":D=e.jsx(nr,{performParentingChecks:t.performParentingChecks,setPerformParentingChecks:r=>R("performParentingChecks",r,"options"),suppressDuplicateDetection:t.suppressDuplicateDetection,setSuppressDuplicateDetection:r=>R("suppressDuplicateDetection",r,"options")});break;case"headers":D=e.jsx(Rt,{items:t.headers,setItems:r=>R("headers",r,"headers"),group:"write"});break;case"bypass":D=e.jsx(Lt,{value:t.bypass,onChange:r=>R("bypass",r,"bypass"),group:"write"});break}const Xe=ke(ge,null),Ye={method:"POST",built:U,headers:Xe,body:Ve,entityLogical:U.entityLogical};return e.jsx(Bt,{sidebar:e.jsx($t,{type:a,urlPreview:U.relativeNoBase,sections:Qe,activeNode:o,onSelect:r=>{u(r),S("builder")},recents:w,onRecentClick:Je}),urlBar:e.jsx(Et,{method:"POST",url:U.relativeUrl,executeVerb:a.executeVerb,writeConfirm:{operation:"Merge Records",table:t.table,scope:{kind:"text",text:"2 records: the subordinate merges into the master and is deactivated"},highImpact:!0},disabledReason:_e??We,loading:T,onExecute:Ge,advisories:be,onAdvisoryFocus:u}),children:e.jsxs(At,{tab:h,onTabChange:S,resultCount:k?.ok?1:null,children:[h==="builder"&&D,h==="code"&&e.jsx(Ot,{themeMode:s,inputs:Ye}),h==="results"&&e.jsx(zt,{result:k,mode:"single",table:t.table,writeContext:{operation:"merge",table:t.table,recordId:t.targetId,recordName:_(j,Z??void 0),targetName:_(j,Z??void 0),subordinateName:_(j,ee??void 0)}})]})})}function ar({overrideCount:s,subordinateName:a}){return e.jsx(E,{layout:"multiline",intent:"warning",icon:e.jsx(le,{}),style:{marginBottom:14},children:e.jsxs($,{children:[e.jsx(Le,{children:"Merge is irreversible."}),a?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:a})," will be deactivated,"," "]}):"The subordinate will be deactivated, ","its related records re-parent to the Target, and ",e.jsx("strong",{children:s})," field",s===1?"":"s"," on the Target will be overwritten by your overrides. The server also auto-fills any empty Target fields from the Subordinate."]})})}function sr({table:s,target:a,subordinate:i,targetLoading:t,subordinateLoading:d}){const c=Ce(),p=P(s);return p?e.jsxs("div",{className:c.inlineCard,style:{padding:14,marginBottom:14,display:"grid",gridTemplateColumns:"1fr 44px 1fr",gap:10,alignItems:"stretch"},children:[e.jsx(Ne,{tone:"target",chip:"TARGET",chipDescription:"survives the merge",row:a,tbl:p,emptyHint:t?"Loading Target record…":"Pick a Target record."}),e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",color:n.colorNeutralForeground3},children:e.jsx(Ie,{style:{width:28,height:28}})}),e.jsx(Ne,{tone:"sub",chip:"SUBORDINATE",chipDescription:"will be deactivated",row:i,tbl:p,emptyHint:d?"Loading Subordinate record…":"Pick a Subordinate record."})]}):null}function Ne({tone:s,chip:a,chipDescription:i,row:t,tbl:d,emptyHint:c}){const p=s==="target"?{border:`1px solid ${n.colorPaletteGreenBorderActive}`,background:n.colorPaletteGreenBackground1}:{border:`1px solid ${n.colorPaletteDarkOrangeBorderActive}`,background:n.colorPaletteDarkOrangeBackground1},o=s==="target"?n.colorPaletteGreenForeground1:n.colorPaletteDarkOrangeForeground1,u=_(d,t),h=t?String(t[d.primaryKey]??""):null,S=t?.createdon?String(t.createdon):null,k=S?new Date(S).toLocaleDateString(void 0,{year:"numeric",month:"short"}):null;return e.jsxs("div",{style:{...p,borderRadius:n.borderRadiusMedium,padding:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(Q,{appearance:"filled",style:{background:o,color:n.colorNeutralForegroundOnBrand,fontWeight:700,letterSpacing:.4},children:a}),e.jsx(M,{style:{color:n.colorNeutralForeground3},children:i})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[e.jsx(Jt,{size:"small",name:u??"?",avatar:{color:"colorful"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600},children:u??"(no name)"}),e.jsx("div",{style:{fontFamily:n.fontFamilyMonospace,fontSize:10,color:n.colorNeutralForeground3},children:h??""})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,fontSize:11,color:n.colorNeutralForeground3},children:[k&&e.jsxs("div",{children:["Created:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:k})]}),t.accountnumber!=null&&e.jsxs("div",{children:["Account #:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2,fontFamily:n.fontFamilyMonospace},children:String(t.accountnumber)})]}),t.revenue!=null&&e.jsxs("div",{children:["Revenue:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:Number(t.revenue).toLocaleString(void 0,{style:"currency",currency:"USD",maximumFractionDigits:0})})]}),t.emailaddress1!=null&&e.jsxs("div",{children:["Email:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:String(t.emailaddress1)})]})]})]}):e.jsx("div",{style:{padding:"20px 4px",color:n.colorNeutralForeground3,fontSize:12,fontStyle:"italic",textAlign:"center"},children:c})]})}function ir({state:s,setState:a,markDirty:i,onEntityChange:t}){const d=P(s.table),{allEntities:c,allLoading:p}=De(),o=b.useMemo(()=>de.map(u=>c.find(h=>h.logicalName===u)).filter(u=>!!u),[c]);return e.jsxs("div",{children:[e.jsx(G,{icon:Wt,title:"Merge entity type",sub:`Pick the table to merge. The Merge action is restricted to ${Ae}.`,group:"write"}),e.jsxs("div",{style:{maxWidth:560},children:[e.jsx(Re,{label:"Entity",hint:p?"Loading tables…":o.length===0?`No Merge-supported table (${de.join(", ")}) was found in this environment.`:void 0,children:e.jsx(ie,{value:d?.displayName??"",selectedOptions:[s.table],onOptionSelect:(u,h)=>{h.optionValue&&(a(S=>({...S,table:h.optionValue,targetId:null,subordinateId:null,fieldChoices:{},customValues:{},targetSnapshot:null,subordinateSnapshot:null})),i("entity"),i("target"),i("subordinate"),i("fielddiff"),t())},children:o.map(u=>e.jsx(ne,{value:u.logicalName,text:u.displayName,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:u.displayName}),e.jsxs(M,{style:{color:n.colorNeutralForeground3},children:[u.entitySetName," · supports Merge"]})]})},u.logicalName))})}),e.jsx(E,{layout:"multiline",intent:"info",style:{marginTop:14},children:e.jsxs($,{children:["Merge requires both records be the ",e.jsx("strong",{children:"same entity type"}),"."," ",e.jsx("code",{children:"incident"})," behaves differently — per docs, the ",e.jsx("code",{children:"UpdateContent"})," ","parameter is ",e.jsx("strong",{children:"ignored"})," for incident, and the merge runs in the user's security context (not system)."]})})]})]})}function we({title:s,sub:a,table:i,selectedId:t,onPick:d,conflictWith:c}){const p=P(i),o=c&&t&&c===t;return e.jsxs("div",{children:[e.jsx(G,{icon:Pe,title:s,sub:a,group:"write"}),e.jsxs("div",{style:{maxWidth:480},children:[e.jsx(Re,{label:"Record",children:e.jsx(Gt,{table:i,selectedId:t,onPick:u=>d(u?.id??null),placeholder:`Search ${p?.displayName??""} records…`})}),o&&e.jsx(E,{layout:"multiline",intent:"error",style:{marginTop:14},children:e.jsx($,{children:"Target and Subordinate must be different records."})}),!t&&e.jsx(M,{style:{display:"block",marginTop:8,color:n.colorNeutralForeground3},children:"Tip: use the search box to filter by primary name (e.g. account name, contact full name)."})]})]})}function nr({performParentingChecks:s,setPerformParentingChecks:a,suppressDuplicateDetection:i,setSuppressDuplicateDetection:t}){return e.jsxs("div",{children:[e.jsx(G,{icon:Me,title:"Merge options",sub:"Controls applied during the merge operation.",group:"write"}),e.jsxs("div",{style:{maxWidth:720,display:"flex",flexDirection:"column",gap:16},children:[e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:s,onChange:(d,c)=>a(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"PerformParentingChecks"}),e.jsx(M,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:"When enabled, the merge fails if the Target and Subordinate have different parent records. Useful for child entities (e.g. contacts under different accounts)."})]})})}),e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:i,onChange:(d,c)=>t(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"MSCRM.SuppressDuplicateDetection"})," ",e.jsx("code",{style:{fontFamily:n.fontFamilyMonospace,fontSize:11},children:"= true"}),e.jsxs(M,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:["Skip duplicate detection rules when applying ",e.jsx("code",{children:"UpdateContent"})," to the Target. Adds the ",e.jsx("code",{children:"MSCRM.SuppressDuplicateDetection: true"})," request header."]})]})})}),e.jsx(E,{layout:"multiline",intent:"warning",children:e.jsxs($,{children:[e.jsx(Le,{children:"Merge is destructive."}),"The Subordinate is deactivated (",e.jsx("code",{children:"statecode=Inactive"}),") and most of its relationships re-parent to the Target. Some Target fields take Subordinate's value only when the Target's value is empty. Use ",e.jsx("strong",{children:"UpdateContent"})," (the Field comparison pane) to override that."]})})]})]})}function _(s,a){if(!s||!a)return null;const i=a[s.primaryName];return i!=null?String(i):null}export{dr as MergeMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b3 as ze,l as d,u as Z,A as t,ad as W,b4 as Ae,b5 as V,a3 as f,a2 as u,ab as ve,b6 as Oe,b7 as Be,f as je,k as He,b8 as Ve,b9 as We,ba as le,n as Xe,bb as Ue,bc as _e,bd as Ge,be as Je,p as K,q as oe,t as Ke,bf as Ye,bg as Ze,F as de,w as et,bh as tt,bi as at,aS as rt,aT as nt,L as st,z as it,aU as ce,H as lt,aV as ot,bj as dt,ah as ct,N as ue,O as pe,V as me,bk as ut,D as pt,bl as mt,bm as he,bn as ht,bo as ye,bp as Y,bq as $,aL as yt,br as ft,I as fe,J as gt,K as bt,P as xt,R as vt,U as jt,S as St,aZ as kt,a_ as Tt,b0 as wt,b1 as Nt,b2 as qt,bs as Ft}from"./index-XmEQbXiX.js";function ge(c,s=!1,h){const y=new Set,a=[];for(const r of c.navigationProperties){if(r.cardinality==="OneToMany"||!Be(r,s)&&r.relationshipName!==h)continue;const m=`${r.relationshipName}|${r.targetEntity}`;y.has(m)||(y.add(m),a.push({relationshipName:r.relationshipName,sourceTable:r.targetEntity,via:r.referencingAttribute??r.name,manyToMany:r.cardinality==="ManyToMany"}))}return a.sort((r,m)=>r.sourceTable.localeCompare(m.sourceTable)||r.relationshipName.localeCompare(m.relationshipName))}function Pt(c,s,h){return c.navigationProperties.find(a=>a.relationshipName===s&&a.cardinality!=="ManyToOne"&&a.targetEntity===h)?.name??null}function Ct({table:c,value:s,onChange:h}){const y=ze(),a=d.useMemo(()=>ge(c,y,s.relationshipName),[c,y,s.relationshipName]),{table:r,loading:m}=Z(s.sourceTable||null);d.useEffect(()=>{if(!r||!s.relationshipName)return;const l=Pt(r,s.relationshipName,c.logicalName)??"";l!==s.navProperty&&h({...s,navProperty:l})},[r,s.relationshipName,c.logicalName]);const b=l=>`${l.relationshipName}|${l.sourceTable}`,x=a.find(l=>l.relationshipName===s.relationshipName&&l.sourceTable===s.sourceTable),v=l=>`${je(l.sourceTable)?.displayName??l.sourceTable} · ${l.relationshipName}`;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsx(W,{label:"Relationship",hint:a.length?`Rows of ${c.displayName} related to one row of another table.`:void 0,validationState:a.length?"none":"warning",validationMessage:a.length?void 0:y&&ge(c).length>0?`None of ${c.displayName}'s lookups or many-to-many relationships are shown in Advanced Find. Turn off "Advanced Find only" in Settings to see them.`:`${c.displayName} has no lookups or many-to-many relationships.`,children:t.jsx(Ae,{placeholder:"Pick a relationship…",value:x?v(x):"",selectedOptions:x?[b(x)]:[],onOptionSelect:(l,P)=>{const k=a.find(I=>b(I)===P.optionValue);k&&h({sourceTable:k.sourceTable,relationshipName:k.relationshipName,navProperty:"",recordId:k.sourceTable===s.sourceTable?s.recordId:null,recordName:k.sourceTable===s.sourceTable?s.recordName:void 0})},listbox:{style:{maxHeight:360}},children:a.map(l=>t.jsx(V,{value:b(l),text:v(l),children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("span",{children:v(l)}),t.jsx(f,{style:{color:u.colorNeutralForeground3,fontFamily:u.fontFamilyMonospace},children:l.manyToMany?`many-to-many · ${l.via}`:`via ${l.via}`})]})},b(l)))})}),s.sourceTable&&m&&!r&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(ve,{size:"tiny"}),t.jsxs(f,{children:["Loading ",s.sourceTable," metadata…"]})]}),r&&s.relationshipName&&!s.navProperty&&t.jsxs(f,{style:{color:u.colorPaletteRedForeground1},children:[r.displayName," has no collection navigation property for ",s.relationshipName,"."]}),r&&s.navProperty&&t.jsx(W,{label:`${r.displayName} row`,hint:t.jsxs("span",{children:["Collection: ",t.jsx("code",{children:`${r.entitySetName}(…)/${s.navProperty}`})]}),children:t.jsx(Oe,{table:r.logicalName,selectedId:s.recordId,onPick:l=>h({...s,recordId:l?.id??null,recordName:l?.primary})})})]})}const $t=()=>({table:"",queryId:null,queryType:"savedQuery",top:50,prefer:{...Tt(),formattedValues:!0},headers:kt(),dirty:new Set}),be={sourceTable:"",relationshipName:"",navProperty:"",recordId:null};function xe(c){if(!c)return[];const s=[...c.matchAll(/<cell\s+([^>]+?)\s*\/?>/g)],h=[];for(const y of s){const a=y[1],r=/name="([^"]+)"/.exec(a);if(!r)continue;const m=r[1],b=/width="([^"]+)"/.exec(a),x=b&&parseInt(b[1],10)||100,v=m.indexOf(".");v>=0?h.push({fullName:m,width:x,isLink:!0,linkAlias:m.slice(0,v),attr:m.slice(v+1)}):h.push({fullName:m,width:x,isLink:!1,attr:m})}return h}function It(c){switch(c){case 0:return"Main view";case 1:return"Advanced Find";case 2:return"Subgrid";case 4:return"Quick Find";case 8:return"Reserved";case 16:return"Lookup";case 32:return"Marketing list";case 64:return"Address book";case 128:return"Main (no subj)";case 256:return"Outlook filter";case 512:return"Reserved";case 1024:return"Offline filter";case 2048:return"Outlook template";case 4096:return"Reserved";case 8192:return"Svc mgmt app";default:return`Type ${c}`}}function Mt({themeMode:c}){const s=He("predefined-query"),h=Ve(),y=We("predefined-query",le,$t),[a,r]=d.useState(y.state),{table:m}=Z(a.table||null),{allEntities:b}=Xe(),[x,v]=d.useState("target"),[l,P]=d.useState("builder"),[k,I]=d.useState(null),[Se,ee]=d.useState(!1),[ke,Te]=d.useState([]),[L,M]=d.useState(y.lastSavedId),[R,Q]=d.useState(y.lastSavedHash),[N,E]=d.useState([]),[X,U]=d.useState(!1),[te,_]=d.useState(null),[T,D]=d.useState(""),{table:we}=Z(a.related?.sourceTable||null),z=d.useMemo(()=>Ue(a),[a,m,we]),G=je(a.table),o=N.find(e=>e.id===a.queryId)??null,A=N.filter(e=>e.kind==="savedQuery"),O=N.filter(e=>e.kind==="userQuery"),B=d.useMemo(()=>{const e=T.trim().toLowerCase();return e?A.filter(i=>i.name.toLowerCase().includes(e)):A},[A,T]),H=d.useMemo(()=>{const e=T.trim().toLowerCase();return e?O.filter(i=>i.name.toLowerCase().includes(e)):O},[O,T]);d.useEffect(()=>{D(o?.name??"")},[o?.name,a.table]),d.useEffect(()=>{let e=!1;if(!a.table){E([]),_(null);return}if(typeof window>"u"||!window.dataverseAPI?.queryData){E([]);return}U(!0),_(null);const i="savedqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype,isdefault,isquickfindquery,iscustomizable,ismanaged",p="userqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype",g=`savedqueries?$select=${i}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`,Qe=`userqueries?$select=${p}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`;return Promise.all([window.dataverseAPI.queryData(g).catch(j=>{throw j instanceof Error?j:new Error(String(j))}),window.dataverseAPI.queryData(Qe).catch(()=>({value:[]}))]).then(([j,J])=>{if(e)return;const Ee=j?.value??[],De=J?.value??[],ie=[...Ee.map(n=>{const S=n.layoutxml!=null?String(n.layoutxml):null;return{id:String(n.savedqueryid??""),name:String(n.name??"(unnamed)"),description:n.description!=null?String(n.description):null,fetchXml:n.fetchxml!=null?String(n.fetchxml):null,layoutXml:S,layoutColumns:xe(S),returnedTypeCode:String(n.returnedtypecode??a.table),queryType:typeof n.querytype=="number"?n.querytype:0,isDefault:n.isdefault===!0,isQuickFind:n.isquickfindquery===!0,isCustom:n.iscustomizable?.Value===!0,isManaged:n.ismanaged===!0,kind:"savedQuery"}}),...De.map(n=>{const S=n.layoutxml!=null?String(n.layoutxml):null;return{id:String(n.userqueryid??""),name:String(n.name??"(unnamed)"),description:n.description!=null?String(n.description):null,fetchXml:n.fetchxml!=null?String(n.fetchxml):null,layoutXml:S,layoutColumns:xe(S),returnedTypeCode:String(n.returnedtypecode??a.table),queryType:typeof n.querytype=="number"?n.querytype:0,isDefault:!1,isQuickFind:!1,isCustom:!0,isManaged:!1,kind:"userQuery"}})];ie.sort((n,S)=>n.kind!==S.kind?n.kind==="savedQuery"?-1:1:n.isDefault!==S.isDefault?n.isDefault?-1:1:n.name.localeCompare(S.name)),E(ie),U(!1)}).catch(j=>{if(e)return;const J=j instanceof Error?j.message:String(j);_(J),E([]),U(!1)}),()=>{e=!0}},[a.table]);const C=e=>r(i=>{const p=new Set(i.dirty);return p.add(e),{...i,dirty:p}}),w=(e,i,p)=>{r(g=>({...g,[e]:i})),p&&C(p)},Ne=e=>{r(i=>({...i,table:e,queryId:null})),C("target"),M(void 0),Q(null)},qe=async()=>{ee(!0);const e=await Nt.predefined(a,fe(a.headers,null));I(e),ee(!1),P("results"),Te(i=>[{id:`r-${Date.now()}`,snapshot:q,modeId:"predefined-query",url:z.relativeUrl,method:"GET",ts:Date.now(),status:e.status,ms:e.ms,rowCount:qt(e.body)??0},...i].slice(0,8)),r(i=>({...i,dirty:new Set}))},Fe=_e([["Query id",a.queryId],["Source row id",a.related?.recordId]],[["Relationship",a.related?.navProperty]]),Pe=a.table?a.queryId?a.related&&!(a.related.navProperty&&a.related.recordId)?"Pick the relationship and the row whose related records to query.":Fe:"Pick a saved query or user view.":"Pick a table first.",q=d.useMemo(()=>Ge(a),[a]);Je("predefined-query",q,L,R);const Ce=d.useMemo(()=>K(q),[q]),ae=R===null?!0:Ce!==R,$e=e=>{M(e.id),Q(K(e.state))},re=e=>{if(e.modeId!=="predefined-query")return;const i=e.state;if(b.length>0&&!b.some(p=>p.logicalName===i.table)){wt(`Can't load "${e.name}": entity \`${i.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}r(le(i)),M(e.id),Q(K(i)),I(null),v("target")},Ie=e=>{const i=Ft(e,"predefined-query");if(!i)return;const p=L,g=R;re(i),M(p),Q(g)},ne=oe($e),se=oe(re);Ke(d.useMemo(()=>a.table?{state:q,modeId:"predefined-query",dirty:ae,lastSavedId:L,onSaved:ne,onLoadSaved:se}:null,[q,ae,L,a.table,ne,se]));const Le=[{id:"target",label:"Target",meta:G?.displayName,items:[{id:"target",icon:Ze,iconFilled:Ye,label:o?.name??(a.table?"Pick a query":"Pick a table"),badge:o?.kind==="savedQuery"?"system":o?.kind==="userQuery"?"user":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")}]},{id:"conditions",label:"Conditions",items:[{id:"conditions",icon:et,iconFilled:de,label:"Filter (read-only)",badge:o?"inherited":null,badgeAppearance:"ghost"}]},{id:"top",label:"Top",items:[{id:"top",icon:at,iconFilled:tt,label:"$top",code:!0,badge:a.top?a.top.toString():"default",badgeAppearance:"ghost",dirty:a.dirty.has("top")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:nt,iconFilled:rt,label:"Prefer header",badge:ce(a.prefer)?"on":null,badgeAppearance:"ghost",dirty:a.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(e=>e.enabled).length} active`,items:[{id:"headers",icon:it,iconFilled:st,label:"HTTP headers",badge:a.headers.filter(e=>e.enabled).length||null,dirty:a.dirty.has("headers")}]}];let F;switch(x){case"target":F=t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsx(pt,{table:a.table,onTableChange:e=>{Ne(e),a.related&&w("related",be)},group:"read",sub:"Pick the table whose saved queries (system views) or user queries (personal views) you want to execute."}),a.table&&t.jsxs("div",{style:{maxWidth:640,display:"flex",flexDirection:"column",gap:14},children:[t.jsx(W,{label:"Run against",hint:a.related?"The query runs over one row’s related records: /<set>(<id>)/<nav>?savedQuery=…":"The query runs over the whole table: /<set>?savedQuery=…",children:t.jsxs(mt,{ariaLabel:"Run the query against",children:[t.jsx(he,{checked:!a.related,onClick:()=>{a.related&&w("related",null,"target")},children:"Table"}),t.jsx(he,{checked:!!a.related,onClick:()=>{a.related||w("related",be,"target")},children:"Related records of a row"})]})}),a.related&&G&&t.jsx(Ct,{table:G,value:a.related,onChange:e=>w("related",e,"target")}),t.jsx(W,{label:"View",hint:N.length>0?`${A.length} system · ${O.length} personal`:void 0,children:t.jsxs(ht,{freeform:!0,clearable:!0,value:T,selectedOptions:a.queryId?[a.queryId]:[],placeholder:X?"Loading queries…":N.length===0?"No queries on this table":"Search views by name…",disabled:X,onChange:e=>{const i=e.target.value;D(i),i===""&&a.queryId&&(r(p=>({...p,queryId:null})),C("target"))},onOptionSelect:(e,i)=>{if(!i.optionValue){r(g=>({...g,queryId:null})),D(""),C("target");return}const p=N.find(g=>g.id===i.optionValue);p&&(r(g=>({...g,queryId:p.id,queryType:p.kind})),D(p.name),C("target"))},listbox:{style:{maxHeight:420}},children:[B.length===0&&H.length===0&&T.trim()&&t.jsx(V,{value:"__none",text:"",disabled:!0,children:t.jsxs(f,{style:{color:u.colorNeutralForeground3},children:['No views match "',T.trim(),'"']})}),B.length>0&&t.jsx(ye,{label:`System views (${B.length})`,children:B.map(e=>t.jsx(V,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Y,{style:{fontWeight:e.isDefault?600:400},children:e.name}),e.description&&t.jsx(f,{style:{color:u.colorNeutralForeground3},children:e.description})]})},e.id))}),H.length>0&&t.jsx(ye,{label:`Personal views (${H.length})`,children:H.map(e=>t.jsx(V,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Y,{children:e.name}),e.description&&t.jsx(f,{style:{color:u.colorNeutralForeground3},children:e.description})]})},e.id))})]})}),X&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:u.colorNeutralForeground3},children:[t.jsx(ve,{size:"tiny"}),t.jsx(f,{children:"Fetching saved + user queries…"})]}),te&&t.jsx(ue,{intent:"error",layout:"multiline",children:t.jsxs(pe,{children:[t.jsx(me,{children:"Couldn't load queries"}),te]})}),o&&t.jsxs("div",{className:ft(h.inlineCard),style:{padding:14,display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[t.jsx(Y,{style:{fontWeight:600},children:o.name}),t.jsx($,{appearance:"ghost",size:"small",children:It(o.queryType)}),o.isDefault&&t.jsx($,{appearance:"tint",color:"brand",size:"small",children:"default view"}),o.isQuickFind&&t.jsx($,{appearance:"tint",color:"informative",size:"small",children:"quick find"}),o.kind==="savedQuery"&&o.isManaged&&t.jsx($,{appearance:"ghost",size:"small",children:"managed"}),o.kind==="savedQuery"&&!o.isManaged&&t.jsx($,{appearance:"ghost",size:"small",children:"unmanaged"})]}),t.jsxs("div",{children:[t.jsx(f,{style:{fontWeight:600,color:u.colorNeutralForeground2},children:"Query GUID"}),t.jsx("div",{children:t.jsx("code",{style:{fontFamily:u.fontFamilyMonospace,fontSize:11,color:u.colorNeutralForeground2},children:o.id})})]}),o.layoutColumns.length>0&&t.jsxs("div",{children:[t.jsxs(f,{style:{fontWeight:600,color:u.colorNeutralForeground2},children:["Result columns (",o.layoutColumns.length,") — from layoutxml"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:o.layoutColumns.map(e=>t.jsx(yt,{relationship:"label",content:e.isLink?`${e.fullName} — joined column via link alias \`${e.linkAlias}\` · width ${e.width}px`:`${e.fullName} — width ${e.width}px`,children:t.jsx("span",{style:{fontFamily:u.fontFamilyMonospace,fontSize:11,padding:"2px 6px",borderRadius:4,background:e.isLink?u.colorPaletteBlueBackground2:u.colorNeutralBackground3,color:e.isLink?u.colorPaletteBlueForeground2:u.colorNeutralForeground1,cursor:"help"},children:e.isLink?`${e.linkAlias}.${e.attr}`:e.attr})},e.fullName))}),o.layoutColumns.some(e=>e.isLink)&&t.jsx(f,{style:{display:"block",marginTop:6,color:u.colorNeutralForeground3},children:"Blue pills are joined columns (link-entity in FetchXml)."})]})]})]})]});break;case"conditions":F=t.jsxs("div",{children:[t.jsx(ct,{icon:de,title:"Conditions",sub:"Read-only summary — predefined queries embed their own FetchXml. Edit the saved query in the model-driven app to change conditions."}),t.jsx(ue,{layout:"multiline",intent:"warning",style:{marginBottom:12},children:t.jsxs(pe,{children:[t.jsx(me,{children:"$select / $filter / $orderby / $expand are locked"}),"With ",t.jsx("code",{children:"?savedQuery=…"})," / ",t.jsx("code",{children:"?userQuery=…"}),", the FetchXml in the query owns column projection, filter, sort and joins. Only ",t.jsx("code",{children:"$top"})," and"," ",t.jsx("code",{children:"Prefer"})," headers remain editable."]})}),o?.fetchXml?t.jsx("div",{style:{border:`1px solid ${u.colorNeutralStroke2}`,borderRadius:u.borderRadiusMedium,overflow:"hidden",height:480},children:t.jsx(ut,{height:"100%",language:"xml",value:o.fetchXml,theme:c==="dark"?"vs-dark":"light",options:{readOnly:!0,domReadOnly:!0,lineNumbers:"on",renderLineHighlight:"line",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontFamily:"Cascadia Mono, Consolas, monospace",fontSize:13,tabSize:2,wordWrap:"on",automaticLayout:!0,padding:{top:12,bottom:12},bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},smoothScrolling:!0}})}):o?t.jsx(f,{style:{color:u.colorNeutralForeground3},children:"(No FetchXml available for this query — it may be a layout-only definition.)"}):t.jsx(f,{style:{color:u.colorNeutralForeground3},children:"Pick a query in Target to see its FetchXml."})]});break;case"top":F=t.jsx(dt,{top:a.top,setTop:e=>w("top",e,"top"),maxPageSize:a.prefer.maxpagesize});break;case"prefer":F=t.jsx(ot,{spec:a.prefer,setSpec:e=>w("prefer",e,"prefer"),sendsPageSize:!0});break;case"headers":F=t.jsx(lt,{policy:"read",items:a.headers,setItems:e=>w("headers",e,"headers")});break}const Me=fe(a.headers,ce(a.prefer)),Re={method:"GET",built:z,headers:Me};return t.jsx(gt,{sidebar:t.jsx(St,{type:s,urlPreview:z.relativeNoBase,sections:Le,activeNode:x,onSelect:e=>{v(e),P("builder")},recents:ke,onRecentClick:Ie}),urlBar:t.jsx(jt,{method:"GET",url:z.relativeUrl,executeVerb:s.executeVerb,disabledReason:Pe,loading:Se,onExecute:qe}),children:t.jsxs(bt,{tab:l,onTabChange:P,resultCount:k?.body?.value?.length??null,children:[l==="builder"&&F,l==="code"&&t.jsx(xt,{themeMode:c,inputs:Re}),l==="results"&&t.jsx(vt,{result:k,mode:"multi",table:a.table,preferredColumnOrder:o?.layoutColumns.map(e=>e.fullName)})]})})}export{Mt as PredefinedQueryMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as I,aP as O,l as i,aQ as q,aR as R,aG as W,aS as _,aT as Y,L as J,z as K,aU as L,A as e,H as Q,aV as X,ah as Z,N as S,O as w,V as T,aL as k,Y as j,aW as ee,aX as te,ad as ae,al as se,a2 as l,a3 as re,aY as ne,a1 as ie,I as C,J as le,K as oe,P as de,R as ce,U as ue,S as he,aZ as pe,a_ as xe,a$ as me,b0 as P,b1 as ye,b2 as be}from"./index-XmEQbXiX.js";const ge=()=>({url:"",prefer:xe(),headers:pe(),dirty:new Set});function fe(y,o){const d={ok:!1,url:null,host:"",path:"",entitySet:null,skiptoken:null,params:[],errors:[]};if(!y.trim())return d;let t;try{t=new URL(y)}catch{return{...d,errors:["Not a valid URL — paste the full https://… string."]}}const n=[];t.protocol!=="https:"&&n.push("Must be https:// — Dataverse rejects plain HTTP.");const c=t.pathname.match(/^\/api\/data\/v\d+\.\d+\/([^/?]+)/);c||n.push("Path doesn't look like a Dataverse Web API URL (expected /api/data/v<x>.<x>/<entityset>)."),o&&t.host&&t.host.toLowerCase()!==o.toLowerCase()&&n.push(`URL host (${t.host}) doesn't match the connected environment (${o}). Switch connections or paste a URL from the current org.`);const h=[];t.searchParams.forEach((p,b)=>h.push({key:b,value:p}));const u=t.searchParams.get("$skiptoken");return{ok:n.length===0,url:t,host:t.host,path:t.pathname,entitySet:c?c[1]:null,skiptoken:u,params:h,errors:n}}function je({themeMode:y}){const o=I("retrieve-nextlink"),d=O(),[t,n]=i.useState(ge),[c,h]=i.useState("url"),[u,p]=i.useState("builder"),[b,U]=i.useState(null),[N,v]=i.useState(!1),[F,M]=i.useState([]),f=i.useMemo(()=>q(t),[t]),r=i.useMemo(()=>fe(t.url,d.host),[t.url,d.host]),B=a=>n(s=>{const m=new Set(s.dirty);return m.add(a),{...s,dirty:m}}),x=(a,s,m)=>{n(G=>({...G,[a]:s})),m&&B(m)},$=i.useMemo(()=>r.errors.map((a,s)=>({id:`nl-err-${s}`,severity:"error",source:"validation",focusNode:"url",title:"Invalid next-link URL",body:a})),[r]),E=async()=>{if(!r.ok)return;v(!0);const a=await ye.nextLink(t,C(t.headers,null));U(a),v(!1),p("results"),M(s=>[{id:`r-${Date.now()}`,modeId:"retrieve-nextlink",url:t.url,method:"GET",ts:Date.now(),status:a.status,ms:a.ms,rowCount:be(a.body)??0},...s].slice(0,8)),n(s=>({...s,dirty:new Set}))},z=t.url.trim()?r.ok?null:r.errors[0]??"URL is not safe to follow.":"Paste an @odata.nextLink URL first.",D=async()=>{const a=await me();a?.trim()?x("url",a.trim(),"url"):a===null?P("The clipboard couldn't be read here. Click in the URL box and press Ctrl+V.",{title:"Couldn't paste",intent:"warning"}):P("The clipboard has no text to paste.",{title:"Nothing to paste",intent:"info"})},H=[{id:"url",label:"Target",meta:"Server-issued",items:[{id:"url",icon:W,iconFilled:R,label:"@odata.nextLink",badge:r.entitySet??(t.url?"invalid":"empty"),badgeAppearance:"ghost",badgeColor:r.errors.length?"danger":r.entitySet?"informative":"subtle",dirty:t.dirty.has("url")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:Y,iconFilled:_,label:"Prefer header",badge:L(t.prefer)?"on":null,badgeAppearance:"ghost",dirty:t.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(a=>a.enabled).length} active`,items:[{id:"headers",icon:K,iconFilled:J,label:"HTTP headers",badge:t.headers.filter(a=>a.enabled).length||null,dirty:t.dirty.has("headers")}]}];let g;switch(c){case"url":g=e.jsxs("div",{children:[e.jsx(Z,{icon:R,title:"Next-link URL",sub:"Paste the @odata.nextLink returned by the previous page. The URL is opaque — clauses are not editable here."}),e.jsx(S,{layout:"multiline",intent:"info",style:{marginBottom:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Why no clause editor?"}),"The next page must use the ",e.jsx("strong",{children:"same shape"})," as the original query. Dataverse encodes paging state in a ",e.jsx("code",{children:"$skiptoken"})," cookie — editing any other clause invalidates the cursor."]})}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[e.jsx(k,{content:"Paste from clipboard",relationship:"label",children:e.jsx(j,{icon:e.jsx(ee,{}),appearance:"outline",size:"small",onClick:D,children:"Paste"})}),e.jsx(k,{content:"Clear the URL field",relationship:"label",children:e.jsx(j,{icon:e.jsx(te,{}),appearance:"subtle",size:"small",disabled:!t.url,onClick:()=>x("url","","url"),children:"Clear"})})]}),e.jsx(ae,{label:"@odata.nextLink",hint:"The full URL including https://. Skiptoken cookies are URL-encoded inside.",children:e.jsx(se,{rows:6,value:t.url,onChange:(a,s)=>x("url",s.value,"url"),placeholder:`https://${d.host}/api/data/v9.2/<entityset>?$select=…&$skiptoken=…`,style:{fontFamily:l.fontFamilyMonospace,fontSize:11}})}),r.errors.map((a,s)=>e.jsx(S,{intent:"error",layout:"multiline",style:{marginTop:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Can't follow this URL"}),a]})},s)),r.url&&r.ok&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${l.colorNeutralStroke2}`,borderRadius:l.borderRadiusMedium,background:l.colorNeutralBackground1},children:[e.jsx(re,{style:{display:"block",fontWeight:600,marginBottom:8,color:l.colorNeutralForeground2},children:"Parsed (read-only)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,columnGap:12,fontFamily:l.fontFamilyMonospace,fontSize:11},children:[e.jsx("span",{style:{color:l.colorNeutralForeground3},children:"host"}),e.jsx("span",{children:r.host}),e.jsx("span",{style:{color:l.colorNeutralForeground3},children:"entityset"}),e.jsx("span",{children:r.entitySet??"—"}),r.params.map((a,s)=>e.jsxs("span",{style:{display:"contents"},children:[e.jsx("span",{style:{color:l.colorBrandForeground1},children:a.key}),e.jsx("span",{style:{wordBreak:"break-all"},children:ne(a.value)})]},s))]})]}),r.ok&&e.jsx("div",{style:{marginTop:16},children:e.jsx(k,{content:"Open the parsed URL in a new tab (auth will be required)",relationship:"description",children:e.jsx(j,{icon:e.jsx(ie,{}),appearance:"outline",onClick:()=>window.open(t.url,"_blank","noopener"),children:"Open in new tab"})})})]});break;case"prefer":g=e.jsx(X,{spec:t.prefer,setSpec:a=>x("prefer",a,"prefer"),sendsPageSize:!0});break;case"headers":g=e.jsx(Q,{policy:"read",items:t.headers,setItems:a=>x("headers",a,"headers")});break}const V=C(t.headers,L(t.prefer)),A={method:"GET",built:f,headers:V,isNextLink:!0,rawNextLink:t.url};return e.jsx(le,{sidebar:e.jsx(he,{type:o,urlPreview:f.relativeNoBase,sections:H,activeNode:c,onSelect:a=>{h(a),p("builder")},recents:F}),urlBar:e.jsx(ue,{method:"GET",url:f.relativeUrl,executeVerb:o.executeVerb,disabledReason:z,loading:N,onExecute:E,advisories:$,onAdvisoryFocus:a=>h(a)}),children:e.jsxs(oe,{tab:u,onTabChange:p,resultCount:b?.body?.value?.length??null,children:[u==="builder"&&g,u==="code"&&e.jsx(de,{themeMode:y,inputs:A}),u==="results"&&e.jsx(ce,{result:b,mode:"next"})]})})}export{je as RetrieveNextLinkMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},t={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{e as conf,t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},s=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1),t=[];s.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var i={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{n as conf,i as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:"#"}},t={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{e as conf,t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};export{e as conf,s as language};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var n=e=>`\\b${e}\\b`,t="[_a-zA-Z]",o="[_a-zA-Z0-9]",r=n(`${t}${o}*`),i=["targetScope","resource","module","param","var","output","for","in","if","existing"],a=["true","false","null"],s="[ \\t\\r\\n]",c="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
|
|
2
|
-
`,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:i,namedLiterals:a,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:s},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:c,action:{token:"number"}},{regex:r,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};export{g as conf,l as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},o={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,o as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},t={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/@qualifiedSymbols/,{cases:{"^:.+$":"constant","@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/[\s,]+/,"white"],[/;.*$/,"comment"],[/\(comment\b/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^()]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/"/,"string","@popall"],[/@escapes/,"string.escape"],[/./,"string"]]}};export{e as conf,t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},r={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,"variable.predefined"],[/[a-zA-Z_]\w*/,{cases:{this:"variable.predefined","@keywords":{token:"keyword.$0"},"@default":""}}],[/[ \t\r\n]+/,""],[/###/,"comment","@comment"],[/#.*$/,"comment"],["///",{token:"regexp",next:"@hereregexp"}],[/^(\s*)(@regEx)/,["","regexp"]],[/(\()(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\,)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\=)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\:)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\[)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\!)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\&)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\|)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\?)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\{)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\;)(\s*)(@regEx)/,["","","regexp"]],[/}/,{cases:{"$S2==interpolatedstring":{token:"string",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"],[/[,.]/,"delimiter"],[/"""/,"string",'@herestring."""'],[/'''/,"string","@herestring.'''"],[/"/,{cases:{"@eos":"string","@default":{token:"string",next:'@string."'}}}],[/'/,{cases:{"@eos":"string","@default":{token:"string",next:"@string.'"}}}]],string:[[/[^"'\#\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\./,"string.escape.invalid"],[/#{/,{cases:{'$S2=="':{token:"string",next:"root.interpolatedstring"},"@default":"string"}}],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/#/,"string"]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/#{/,{token:"string.quote",next:"root.interpolatedstring"}],[/#/,"string"]],comment:[[/[^#]+/,"comment"],[/###/,"comment","@pop"],[/#/,"comment"]],hereregexp:[[/[^\\\/#]+/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*",{token:"regexp",next:"@pop"}],[/\//,"regexp"]]}};export{e as conf,r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},n={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m512","__m512d","__m512i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[0abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,integersuffix:/([uU](ll|LL|l|L)|(ll|LL|l|L)?[uU]?)/,floatsuffix:/[fFlL]?/,encoding:/u|u8|U|L/,tokenizer:{root:[[/@encoding?R\"(?:([^ ()\\\t]*))\(/,{token:"string.raw.begin",next:"@raw.$1"}],[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/^\s*#\s*include/,{token:"keyword.directive.include",next:"@include"}],[/^\s*#\s*\w+/,"keyword.directive"],{include:"@whitespace"},[/\[\s*\[/,{token:"annotation",next:"@annotation"}],[/[{}()<>\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/[^)]+/,"string.raw"],[/\)$S2\"/,{token:"string.raw.end",next:"@pop"}],[/\)/,"string.raw"]],annotation:[{include:"@whitespace"},[/using|alignas/,"keyword"],[/[a-zA-Z0-9_]+/,"annotation"],[/[,:]/,"delimiter"],[/[()]/,"@brackets"],[/\]\s*\]/,{token:"annotation",next:"@pop"}]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}};export{e as conf,n as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={brackets:[],autoClosingPairs:[],surroundingPairs:[]},r={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/child-src/,"string.quote"],[/connect-src/,"string.quote"],[/default-src/,"string.quote"],[/font-src/,"string.quote"],[/frame-src/,"string.quote"],[/img-src/,"string.quote"],[/manifest-src/,"string.quote"],[/media-src/,"string.quote"],[/object-src/,"string.quote"],[/script-src/,"string.quote"],[/style-src/,"string.quote"],[/worker-src/,"string.quote"],[/base-uri/,"string.quote"],[/plugin-types/,"string.quote"],[/sandbox/,"string.quote"],[/disown-opener/,"string.quote"],[/form-action/,"string.quote"],[/frame-ancestors/,"string.quote"],[/report-uri/,"string.quote"],[/report-to/,"string.quote"],[/upgrade-insecure-requests/,"string.quote"],[/block-all-mixed-content/,"string.quote"],[/require-sri-for/,"string.quote"],[/reflected-xss/,"string.quote"],[/referrer/,"string.quote"],[/policy-uri/,"string.quote"],[/'self'/,"string.quote"],[/'unsafe-inline'/,"string.quote"],[/'unsafe-eval'/,"string.quote"],[/'strict-dynamic'/,"string.quote"],[/'unsafe-hashed-attributes'/,"string.quote"]]}};export{t as conf,r as language};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var e={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t={defaultToken:"",tokenPostfix:".css",ws:`[
|
|
2
|
-
\r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r
|
|
3
|
-
]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};export{e as conf,t as language};
|