@project-sunbird/collection-editor-react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bulkUpload.d.ts +10 -0
- package/dist/api/categoryDefinition.d.ts +45 -0
- package/dist/api/client.d.ts +3 -0
- package/dist/api/content.d.ts +15 -0
- package/dist/api/dialcode.d.ts +12 -0
- package/dist/api/framework.d.ts +4 -0
- package/dist/api/hierarchy.d.ts +12 -0
- package/dist/api/user.d.ts +25 -0
- package/dist/collection-editor.umd.js +466 -0
- package/dist/components/AssetBrowser/AssetBrowser.d.ts +9 -0
- package/dist/components/AssetBrowser/index.d.ts +1 -0
- package/dist/components/AssignPageNumber/AssignPageNumber.d.ts +8 -0
- package/dist/components/AssignPageNumber/index.d.ts +1 -0
- package/dist/components/BulkUpload/CsvUpload.d.ts +10 -0
- package/dist/components/BulkUpload/index.d.ts +1 -0
- package/dist/components/Collaborators/ManageCollaborators.d.ts +8 -0
- package/dist/components/Collaborators/index.d.ts +1 -0
- package/dist/components/CollectionEditor/CollectionEditor.d.ts +5 -0
- package/dist/components/CollectionEditor/index.d.ts +2 -0
- package/dist/components/ContentPlayer/ContentPlayer.d.ts +10 -0
- package/dist/components/ContentPlayer/index.d.ts +1 -0
- package/dist/components/ContextualEditor/Breadcrumb.d.ts +10 -0
- package/dist/components/ContextualEditor/ContentEditForm.d.ts +11 -0
- package/dist/components/ContextualEditor/ContextualEditor.d.ts +12 -0
- package/dist/components/ContextualEditor/TabBar.d.ts +21 -0
- package/dist/components/ContextualEditor/TitleAppIcon.d.ts +9 -0
- package/dist/components/ContextualEditor/index.d.ts +1 -0
- package/dist/components/Dialcode/DialcodePanel.d.ts +10 -0
- package/dist/components/Dialcode/index.d.ts +1 -0
- package/dist/components/LibraryDock/FilterChips.d.ts +13 -0
- package/dist/components/LibraryDock/LibraryCard.d.ts +12 -0
- package/dist/components/LibraryDock/LibraryDock.d.ts +10 -0
- package/dist/components/LibraryDock/LibraryFilterPanel.d.ts +19 -0
- package/dist/components/LibraryDock/LibraryPreviewPanel.d.ts +10 -0
- package/dist/components/LibraryDock/index.d.ts +1 -0
- package/dist/components/OutlineTree/OutlineTree.d.ts +10 -0
- package/dist/components/OutlineTree/TreeNode.d.ts +9 -0
- package/dist/components/OutlineTree/index.d.ts +1 -0
- package/dist/components/ProgressStatus/ProgressStatus.d.ts +12 -0
- package/dist/components/ProgressStatus/index.d.ts +1 -0
- package/dist/components/ResourceReorder/ResourceReorderDialog.d.ts +10 -0
- package/dist/components/ResourceReorder/index.d.ts +1 -0
- package/dist/components/SparkMetaForm/FormSection.d.ts +9 -0
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +14 -0
- package/dist/components/SparkMetaForm/fields/AppIconField.d.ts +11 -0
- package/dist/components/SparkMetaForm/fields/AppIconPickerModal.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/ChipGroupField.d.ts +11 -0
- package/dist/components/SparkMetaForm/fields/DateTimeField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/DialcodeInputField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/KeywordSuggestField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/LicenseSelectField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/MultiSelectField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/NestedSelectField.d.ts +20 -0
- package/dist/components/SparkMetaForm/fields/RadioField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/SelectField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/TextField.d.ts +13 -0
- package/dist/components/SparkMetaForm/fields/index.d.ts +11 -0
- package/dist/components/SparkMetaForm/hooks/index.d.ts +3 -0
- package/dist/components/SparkMetaForm/hooks/useCascade.d.ts +16 -0
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +42 -0
- package/dist/components/SparkMetaForm/index.d.ts +1 -0
- package/dist/components/SplitBuilderShell/SplitBuilderShell.d.ts +14 -0
- package/dist/components/SplitBuilderShell/index.d.ts +1 -0
- package/dist/components/Topbar/Topbar.d.ts +15 -0
- package/dist/components/Topbar/index.d.ts +1 -0
- package/dist/components/UnitContentList/ContentRow.d.ts +10 -0
- package/dist/components/UnitContentList/UnitContentList.d.ts +8 -0
- package/dist/components/UnitContentList/index.d.ts +1 -0
- package/dist/components/modals/ConfirmDialog.d.ts +13 -0
- package/dist/components/modals/PublishChecklist.d.ts +9 -0
- package/dist/components/modals/QualityParamsModal.d.ts +10 -0
- package/dist/components/modals/index.d.ts +3 -0
- package/dist/components/shared/Button.d.ts +14 -0
- package/dist/components/shared/Card.d.ts +9 -0
- package/dist/components/shared/Chip.d.ts +12 -0
- package/dist/components/shared/DropZone.d.ts +10 -0
- package/dist/components/shared/Spinner.d.ts +8 -0
- package/dist/components/shared/index.d.ts +5 -0
- package/dist/dev-main.d.ts +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/useContentType.d.ts +18 -0
- package/dist/hooks/useEditorInit.d.ts +12 -0
- package/dist/hooks/useFramework.d.ts +5 -0
- package/dist/hooks/useLibrary.d.ts +24 -0
- package/dist/hooks/useSaveHierarchy.d.ts +6 -0
- package/dist/hooks/useTelemetry.d.ts +13 -0
- package/dist/hooks/useTree.d.ts +23 -0
- package/dist/index.cjs +466 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +20941 -0
- package/dist/store/editor.store.d.ts +47 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/library.store.d.ts +25 -0
- package/dist/store/tree.store.d.ts +31 -0
- package/dist/store/ui.store.d.ts +9 -0
- package/dist/style.css +1 -0
- package/dist/types/content.d.ts +43 -0
- package/dist/types/editor.d.ts +86 -0
- package/dist/types/framework.d.ts +23 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/utils/telemetry.d.ts +18 -0
- package/dist/web-component/register.d.ts +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
(function(pe,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],p):(pe=typeof globalThis<"u"?globalThis:pe||self,p(pe.CollectionEditorReact={},pe.React,pe.ReactDOM,pe.jsxRuntime))})(this,function(pe,p,Be,l){"use strict";var qh=pe=>{throw TypeError(pe)};var al=(pe,p,Be)=>p.has(pe)||qh("Cannot "+Be);var O=(pe,p,Be)=>(al(pe,p,"read from private field"),Be?Be.call(pe):p.get(pe)),ne=(pe,p,Be)=>p.has(pe)?qh("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(pe):p.set(pe,Be),G=(pe,p,Be,l)=>(al(pe,p,"write to private field"),l?l.call(pe,Be):p.set(pe,Be),Be),he=(pe,p,Be)=>(al(pe,p,"access private method"),Be);var no=(pe,p,Be,l)=>({set _(so){G(pe,p,so,Be)},get _(){return O(pe,p,l)}});var Rr,Tr,Pn,Ph,nr,Xr,Mh,Mn,Ir,Ln,Lh,Zr,Fh,Fn,Jr,$n,jt,en,Ye,As,tn,xt,Wh,yr,$h,_t,ye,Ps,gt,rn,Bn,dr,Nr,Ms,jn,Vn,nn,sn,xr,Un,_e,Us,ll,cl,ul,dl,fl,hl,pl,Kh,Bh,Ls,sr,ut,on,ir,Fr,jh,fr,Rt,Fs,Vh,or,Uh,Fe,kr,Ar,zn,Hn,Pr,qn,Wn,zh;function so(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const be=so(p);var Gn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yh=(Ph=class extends Gn{constructor(){super();ne(this,Rr);ne(this,Tr);ne(this,Pn);G(this,Pn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){O(this,Tr)||this.setEventListener(O(this,Pn))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Tr))==null||t.call(this),G(this,Tr,void 0))}setEventListener(t){var r;G(this,Pn,t),(r=O(this,Tr))==null||r.call(this),G(this,Tr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){O(this,Rr)!==t&&(G(this,Rr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof O(this,Rr)=="boolean"?O(this,Rr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Rr=new WeakMap,Tr=new WeakMap,Pn=new WeakMap,Ph),io=new Yh,Rh={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xh=(Mh=class{constructor(){ne(this,nr,Rh);ne(this,Xr,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&O(this,Xr)&&e!==O(this,nr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:O(this,nr),provider:e}),G(this,nr,e),process.env.NODE_ENV!=="production"&&G(this,Xr,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&G(this,Xr,!0),O(this,nr).setTimeout(e,t)}clearTimeout(e){O(this,nr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&G(this,Xr,!0),O(this,nr).setInterval(e,t)}clearInterval(e){O(this,nr).clearInterval(e)}},nr=new WeakMap,Xr=new WeakMap,Mh),$r=new Xh;function Zh(e){setTimeout(e,0)}var Jh=typeof window>"u"||"Deno"in globalThis;function vt(){}function ep(e,t){return typeof e=="function"?e(t):e}function oo(e){return typeof e=="number"&&e>=0&&e!==1/0}function gl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vr(e,t){return typeof e=="function"?e(t):e}function Ot(e,t){return typeof e=="function"?e(t):e}function yl(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==ao(o,t.options))return!1}else if(!Yn(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function vl(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Qn(t.options.mutationKey)!==Qn(i))return!1}else if(!Yn(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function ao(e,t){return((t==null?void 0:t.queryKeyHashFn)||Qn)(e)}function Qn(e){return JSON.stringify(e,(t,r)=>uo(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Yn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Yn(e[r],t[r])):!1}var tp=Object.prototype.hasOwnProperty;function lo(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=ml(e)&&ml(t);if(!n&&!(uo(e)&&uo(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const f=n?d:o[d],y=e[f],g=t[f];if(y===g){c[f]=y,(n?d<i:tp.call(e,f))&&u++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){c[f]=g;continue}const b=lo(y,g,r+1);c[f]=b,b===y&&u++}return i===a&&u===i?e:c}function co(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ml(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uo(e){if(!bl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!bl(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bl(e){return Object.prototype.toString.call(e)==="[object Object]"}function rp(e){return new Promise(t=>{$r.setTimeout(t,e)})}function fo(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return lo(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return lo(e,t)}return t}function np(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function sp(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var zs=Symbol();function _l(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===zs&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wl(e,t){return typeof e=="function"?e(...t):!!e}function ip(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Rn=(()=>{let e=()=>Jh;return{isServer(){return e()},setIsServer(t){e=t}}})();function ho(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var op=Zh;function ap(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=op;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Ze=ap(),lp=(Lh=class extends Gn{constructor(){super();ne(this,Mn,!0);ne(this,Ir);ne(this,Ln);G(this,Ln,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){O(this,Ir)||this.setEventListener(O(this,Ln))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Ir))==null||t.call(this),G(this,Ir,void 0))}setEventListener(t){var r;G(this,Ln,t),(r=O(this,Ir))==null||r.call(this),G(this,Ir,t(this.setOnline.bind(this)))}setOnline(t){O(this,Mn)!==t&&(G(this,Mn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return O(this,Mn)}},Mn=new WeakMap,Ir=new WeakMap,Ln=new WeakMap,Lh),Hs=new lp;function cp(e){return Math.min(1e3*2**e,3e4)}function Sl(e){return(e??"online")==="online"?Hs.isOnline():!0}var po=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cl(e){let t=!1,r=0,n;const s=ho(),i=()=>s.status!=="pending",o=h=>{var v;if(!i()){const m=new po(h);y(m),(v=e.onCancel)==null||v.call(e,m)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>io.isFocused()&&(e.networkMode==="always"||Hs.isOnline())&&e.canRun(),d=()=>Sl(e.networkMode)&&e.canRun(),f=h=>{i()||(n==null||n(),s.resolve(h))},y=h=>{i()||(n==null||n(),s.reject(h))},g=()=>new Promise(h=>{var v;n=m=>{(i()||u())&&h(m)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,i()||(h=e.onContinue)==null||h.call(e)}),b=()=>{if(i())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(m){h=Promise.reject(m)}Promise.resolve(h).then(f).catch(m=>{var D;if(i())return;const _=e.retry??(Rn.isServer()?0:3),S=e.retryDelay??cp,w=typeof S=="function"?S(r,m):S,C=_===!0||typeof _=="number"&&r<_||typeof _=="function"&&_(r,m);if(t||!C){y(m);return}r++,(D=e.onFail)==null||D.call(e,r,m),rp(w).then(()=>u()?void 0:g()).then(()=>{t?y(m):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?b():g().then(b),s)}}var El=(Fh=class{constructor(){ne(this,Zr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oo(this.gcTime)&&G(this,Zr,$r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rn.isServer()?1/0:5*60*1e3))}clearGcTimeout(){O(this,Zr)!==void 0&&($r.clearTimeout(O(this,Zr)),G(this,Zr,void 0))}},Zr=new WeakMap,Fh);function up(e){return{onFetch:(t,r)=>{var d,f,y,g,b;const n=t.options,s=(y=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:y.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{ip(S,()=>t.signal,()=>h=!0)},m=_l(t.options,t.fetchOptions),_=async(S,w,C)=>{if(h)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const x=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};return v(F),F})(),A=await m(x),{maxPages:B}=t.options,P=C?sp:np;return{pages:P(S.pages,A,B),pageParams:P(S.pageParams,w,B)}};if(s&&i.length){const S=s==="backward",w=S?dp:Ol,C={pages:i,pageParams:o},D=w(n,C);a=await _(C,D,S)}else{const S=e??i.length;do{const w=c===0?o[0]??n.initialPageParam:Ol(n,a);if(c>0&&w==null)break;a=await _(a,w),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Ol(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function dp(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var fp=($h=class extends El{constructor(t){super();ne(this,xt);ne(this,Fn);ne(this,Jr);ne(this,$n);ne(this,jt);ne(this,en);ne(this,Ye);ne(this,As);ne(this,tn);G(this,tn,!1),G(this,As,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,en,t.client),G(this,jt,O(this,en).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Jr,Il(this.options)),this.state=t.state??O(this,Jr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return O(this,Fn)}get promise(){var t;return(t=O(this,Ye))==null?void 0:t.promise}setOptions(t){if(this.options={...O(this,As),...t},t!=null&&t._type&&G(this,Fn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Il(this.options);r.data!==void 0&&(this.setState(Tl(r.data,r.dataUpdatedAt)),G(this,Jr,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,jt).remove(this)}setData(t,r){const n=fo(this.state.data,t,this.options);return he(this,xt,yr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){he(this,xt,yr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=O(this,Ye))==null?void 0:n.promise;return(s=O(this,Ye))==null||s.cancel(t),r?r.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return O(this,Jr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ot(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!gl(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=O(this,Ye))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=O(this,Ye))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(O(this,Ye)&&(O(this,tn)||he(this,xt,Wh).call(this)?O(this,Ye).cancel({revert:!0}):O(this,Ye).cancelRetry()),this.scheduleGc()),O(this,jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,xt,yr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,y,g,b,h,v,m,_,S;if(this.state.fetchStatus!=="idle"&&((u=O(this,Ye))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(O(this,Ye))return O(this,Ye).continueRetry(),O(this,Ye).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(C=>C.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(G(this,tn,!0),n.signal)})},i=()=>{const w=_l(this.options,r),D=(()=>{const x={client:O(this,en),queryKey:this.queryKey,meta:this.meta};return s(x),x})();return G(this,tn,!1),this.options.persister?this.options.persister(w,D,this):w(D)},a=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:O(this,en),state:this.state,fetchFn:i};return s(w),w})(),c=O(this,Fn)==="infinite"?up(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),G(this,$n,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&he(this,xt,yr).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),G(this,Ye,Cl({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:w=>{w instanceof po&&w.revert&&this.setState({...O(this,$n),fetchStatus:"idle"}),n.abort()},onFail:(w,C)=>{he(this,xt,yr).call(this,{type:"failed",failureCount:w,error:C})},onPause:()=>{he(this,xt,yr).call(this,{type:"pause"})},onContinue:()=>{he(this,xt,yr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await O(this,Ye).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(g=(y=O(this,jt).config).onSuccess)==null||g.call(y,w,this),(h=(b=O(this,jt).config).onSettled)==null||h.call(b,w,this.state.error,this),w}catch(w){if(w instanceof po){if(w.silent)return O(this,Ye).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw he(this,xt,yr).call(this,{type:"error",error:w}),(m=(v=O(this,jt).config).onError)==null||m.call(v,w,this),(S=(_=O(this,jt).config).onSettled)==null||S.call(_,this.state.data,w,this),w}finally{this.scheduleGc()}}},Fn=new WeakMap,Jr=new WeakMap,$n=new WeakMap,jt=new WeakMap,en=new WeakMap,Ye=new WeakMap,As=new WeakMap,tn=new WeakMap,xt=new WeakSet,Wh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Dl(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Tl(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,$n,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ze.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),O(this,jt).notify({query:this,type:"updated",action:t})})},$h);function Dl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Sl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Tl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Il(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var hp=(Bh=class extends Gn{constructor(t,r){super();ne(this,_e);ne(this,_t);ne(this,ye);ne(this,Ps);ne(this,gt);ne(this,rn);ne(this,Bn);ne(this,dr);ne(this,Nr);ne(this,Ms);ne(this,jn);ne(this,Vn);ne(this,nn);ne(this,sn);ne(this,xr);ne(this,Un,new Set);this.options=r,G(this,_t,t),G(this,Nr,null),G(this,dr,ho()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,ye).addObserver(this),Nl(O(this,ye),this.options)?he(this,_e,Us).call(this):this.updateResult(),he(this,_e,dl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return go(O(this,ye),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return go(O(this,ye),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,_e,fl).call(this),he(this,_e,hl).call(this),O(this,ye).removeObserver(this)}setOptions(t){const r=this.options,n=O(this,ye);if(this.options=O(this,_t).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ot(this.options.enabled,O(this,ye))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,_e,pl).call(this),O(this,ye).setOptions(this.options),r._defaulted&&!co(this.options,r)&&O(this,_t).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,ye),observer:this});const s=this.hasListeners();s&&xl(O(this,ye),n,this.options,r)&&he(this,_e,Us).call(this),this.updateResult(),s&&(O(this,ye)!==n||Ot(this.options.enabled,O(this,ye))!==Ot(r.enabled,O(this,ye))||vr(this.options.staleTime,O(this,ye))!==vr(r.staleTime,O(this,ye)))&&he(this,_e,ll).call(this);const i=he(this,_e,cl).call(this);s&&(O(this,ye)!==n||Ot(this.options.enabled,O(this,ye))!==Ot(r.enabled,O(this,ye))||i!==O(this,xr))&&he(this,_e,ul).call(this,i)}getOptimisticResult(t){const r=O(this,_t).getQueryCache().build(O(this,_t),t),n=this.createResult(r,t);return gp(this,n)&&(G(this,gt,n),G(this,Bn,this.options),G(this,rn,O(this,ye).state)),n}getCurrentResult(){return O(this,gt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&O(this,dr).status==="pending"&&O(this,dr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){O(this,Un).add(t)}getCurrentQuery(){return O(this,ye)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=O(this,_t).defaultQueryOptions(t),n=O(this,_t).getQueryCache().build(O(this,_t),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return he(this,_e,Us).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,gt)))}createResult(t,r){var B;const n=O(this,ye),s=this.options,i=O(this,gt),o=O(this,rn),a=O(this,Bn),u=t!==n?t.state:O(this,Ps),{state:d}=t;let f={...d},y=!1,g;if(r._optimisticResults){const P=this.hasListeners(),F=!P&&Nl(t,r),q=P&&xl(t,n,r,s);(F||q)&&(f={...f,...Dl(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;g=f.data;let m=!1;if(r.placeholderData!==void 0&&g===void 0&&v==="pending"){let P;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(P=i.data,m=!0):P=typeof r.placeholderData=="function"?r.placeholderData((B=O(this,Vn))==null?void 0:B.state.data,O(this,Vn)):r.placeholderData,P!==void 0&&(v="success",g=fo(i==null?void 0:i.data,P,r),y=!0)}if(r.select&&g!==void 0&&!m)if(i&&g===(o==null?void 0:o.data)&&r.select===O(this,Ms))g=O(this,jn);else try{G(this,Ms,r.select),g=r.select(g),g=fo(i==null?void 0:i.data,g,r),G(this,jn,g),G(this,Nr,null)}catch(P){G(this,Nr,P)}O(this,Nr)&&(b=O(this,Nr),g=O(this,jn),h=Date.now(),v="error");const _=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",C=S&&_,D=g!==void 0,A={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!S,isLoadingError:w&&!D,isPaused:f.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:w&&D,isStale:yo(t,r),refetch:this.refetch,promise:O(this,dr),isEnabled:Ot(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=A.data!==void 0,F=A.status==="error"&&!P,q=$=>{F?$.reject(A.error):P&&$.resolve(A.data)},k=()=>{const $=G(this,dr,A.promise=ho());q($)},L=O(this,dr);switch(L.status){case"pending":t.queryHash===n.queryHash&&q(L);break;case"fulfilled":(F||A.data!==L.value)&&k();break;case"rejected":(!F||A.error!==L.reason)&&k();break}}return A}updateResult(){const t=O(this,gt),r=this.createResult(O(this,ye),this.options);if(G(this,rn,O(this,ye).state),G(this,Bn,this.options),O(this,rn).data!==void 0&&G(this,Vn,O(this,ye)),co(r,t))return;G(this,gt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!O(this,Un).size)return!0;const o=new Set(i??O(this,Un));return this.options.throwOnError&&o.add("error"),Object.keys(O(this,gt)).some(a=>{const c=a;return O(this,gt)[c]!==t[c]&&o.has(c)})};he(this,_e,Kh).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,_e,dl).call(this)}},_t=new WeakMap,ye=new WeakMap,Ps=new WeakMap,gt=new WeakMap,rn=new WeakMap,Bn=new WeakMap,dr=new WeakMap,Nr=new WeakMap,Ms=new WeakMap,jn=new WeakMap,Vn=new WeakMap,nn=new WeakMap,sn=new WeakMap,xr=new WeakMap,Un=new WeakMap,_e=new WeakSet,Us=function(t){he(this,_e,pl).call(this);let r=O(this,ye).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(vt)),r},ll=function(){he(this,_e,fl).call(this);const t=vr(this.options.staleTime,O(this,ye));if(Rn.isServer()||O(this,gt).isStale||!oo(t))return;const n=gl(O(this,gt).dataUpdatedAt,t)+1;G(this,nn,$r.setTimeout(()=>{O(this,gt).isStale||this.updateResult()},n))},cl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,ye)):this.options.refetchInterval)??!1},ul=function(t){he(this,_e,hl).call(this),G(this,xr,t),!(Rn.isServer()||Ot(this.options.enabled,O(this,ye))===!1||!oo(O(this,xr))||O(this,xr)===0)&&G(this,sn,$r.setInterval(()=>{(this.options.refetchIntervalInBackground||io.isFocused())&&he(this,_e,Us).call(this)},O(this,xr)))},dl=function(){he(this,_e,ll).call(this),he(this,_e,ul).call(this,he(this,_e,cl).call(this))},fl=function(){O(this,nn)!==void 0&&($r.clearTimeout(O(this,nn)),G(this,nn,void 0))},hl=function(){O(this,sn)!==void 0&&($r.clearInterval(O(this,sn)),G(this,sn,void 0))},pl=function(){const t=O(this,_t).getQueryCache().build(O(this,_t),this.options);if(t===O(this,ye))return;const r=O(this,ye);G(this,ye,t),G(this,Ps,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Kh=function(t){Ze.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(O(this,gt))}),O(this,_t).getQueryCache().notify({query:O(this,ye),type:"observerResultsUpdated"})})},Bh);function pp(e,t){return Ot(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ot(t.retryOnMount,e)===!1)}function Nl(e,t){return pp(e,t)||e.state.data!==void 0&&go(e,t,t.refetchOnMount)}function go(e,t,r){if(Ot(t.enabled,e)!==!1&&vr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&yo(e,t)}return!1}function xl(e,t,r,n){return(e!==t||Ot(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&yo(e,r)}function yo(e,t){return Ot(t.enabled,e)!==!1&&e.isStaleByTime(vr(t.staleTime,e))}function gp(e,t){return!co(e.getCurrentResult(),t)}var yp=(jh=class extends El{constructor(t){super();ne(this,ir);ne(this,Ls);ne(this,sr);ne(this,ut);ne(this,on);G(this,Ls,t.client),this.mutationId=t.mutationId,G(this,ut,t.mutationCache),G(this,sr,[]),this.state=t.state||vp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,sr).includes(t)||(O(this,sr).push(t),this.clearGcTimeout(),O(this,ut).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,sr,O(this,sr).filter(r=>r!==t)),this.scheduleGc(),O(this,ut).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,sr).length||(this.state.status==="pending"?this.scheduleGc():O(this,ut).remove(this))}continue(){var t;return((t=O(this,on))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,c,u,d,f,y,g,b,h,v,m,_,S,w,C,D,x;const r=()=>{he(this,ir,Fr).call(this,{type:"continue"})},n={client:O(this,Ls),meta:this.options.meta,mutationKey:this.options.mutationKey};G(this,on,Cl({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,B)=>{he(this,ir,Fr).call(this,{type:"failed",failureCount:A,error:B})},onPause:()=>{he(this,ir,Fr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,ut).canRun(this)}));const s=this.state.status==="pending",i=!O(this,on).canStart();try{if(s)r();else{he(this,ir,Fr).call(this,{type:"pending",variables:t,isPaused:i}),O(this,ut).config.onMutate&&await O(this,ut).config.onMutate(t,this,n);const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,n));B!==this.state.context&&he(this,ir,Fr).call(this,{type:"pending",context:B,variables:t,isPaused:i})}const A=await O(this,on).start();return await((u=(c=O(this,ut).config).onSuccess)==null?void 0:u.call(c,A,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,A,t,this.state.context,n)),await((g=(y=O(this,ut).config).onSettled)==null?void 0:g.call(y,A,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,A,null,t,this.state.context,n)),he(this,ir,Fr).call(this,{type:"success",data:A}),A}catch(A){try{await((m=(v=O(this,ut).config).onError)==null?void 0:m.call(v,A,t,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((S=(_=this.options).onError)==null?void 0:S.call(_,A,t,this.state.context,n))}catch(B){Promise.reject(B)}try{await((C=(w=O(this,ut).config).onSettled)==null?void 0:C.call(w,void 0,A,this.state.variables,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((x=(D=this.options).onSettled)==null?void 0:x.call(D,void 0,A,t,this.state.context,n))}catch(B){Promise.reject(B)}throw he(this,ir,Fr).call(this,{type:"error",error:A}),A}finally{O(this,ut).runNext(this)}}},Ls=new WeakMap,sr=new WeakMap,ut=new WeakMap,on=new WeakMap,ir=new WeakSet,Fr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ze.batch(()=>{O(this,sr).forEach(n=>{n.onMutationUpdate(t)}),O(this,ut).notify({mutation:this,type:"updated",action:t})})},jh);function vp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mp=(Vh=class extends Gn{constructor(t={}){super();ne(this,fr);ne(this,Rt);ne(this,Fs);this.config=t,G(this,fr,new Set),G(this,Rt,new Map),G(this,Fs,0)}build(t,r,n){const s=new yp({client:t,mutationCache:this,mutationId:++no(this,Fs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){O(this,fr).add(t);const r=qs(t);if(typeof r=="string"){const n=O(this,Rt).get(r);n?n.push(t):O(this,Rt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,fr).delete(t)){const r=qs(t);if(typeof r=="string"){const n=O(this,Rt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&O(this,Rt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=qs(t);if(typeof r=="string"){const n=O(this,Rt).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=qs(t);if(typeof r=="string"){const s=(n=O(this,Rt).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ze.batch(()=>{O(this,fr).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,fr).clear(),O(this,Rt).clear()})}getAll(){return Array.from(O(this,fr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>vl(r,n))}findAll(t={}){return this.getAll().filter(r=>vl(t,r))}notify(t){Ze.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ze.batch(()=>Promise.all(t.map(r=>r.continue().catch(vt))))}},fr=new WeakMap,Rt=new WeakMap,Fs=new WeakMap,Vh);function qs(e){var t;return(t=e.options.scope)==null?void 0:t.id}var bp=(Uh=class extends Gn{constructor(t={}){super();ne(this,or);this.config=t,G(this,or,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??ao(s,r);let o=this.get(i);return o||(o=new fp({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){O(this,or).has(t.queryHash)||(O(this,or).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=O(this,or).get(t.queryHash);r&&(t.destroy(),r===t&&O(this,or).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ze.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,or).get(t)}getAll(){return[...O(this,or).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>yl(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>yl(t,n)):r}notify(t){Ze.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ze.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ze.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},or=new WeakMap,Uh),_p=(zh=class{constructor(e={}){ne(this,Fe);ne(this,kr);ne(this,Ar);ne(this,zn);ne(this,Hn);ne(this,Pr);ne(this,qn);ne(this,Wn);G(this,Fe,e.queryCache||new bp),G(this,kr,e.mutationCache||new mp),G(this,Ar,e.defaultOptions||{}),G(this,zn,new Map),G(this,Hn,new Map),G(this,Pr,0)}mount(){no(this,Pr)._++,O(this,Pr)===1&&(G(this,qn,io.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,Fe).onFocus())})),G(this,Wn,Hs.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,Fe).onOnline())})))}unmount(){var e,t;no(this,Pr)._--,O(this,Pr)===0&&((e=O(this,qn))==null||e.call(this),G(this,qn,void 0),(t=O(this,Wn))==null||t.call(this),G(this,Wn,void 0))}isFetching(e){return O(this,Fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,kr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=O(this,Fe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=O(this,Fe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(vr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return O(this,Fe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=O(this,Fe).get(n.queryHash),i=s==null?void 0:s.state.data,o=ep(t,i);if(o!==void 0)return O(this,Fe).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ze.batch(()=>O(this,Fe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=O(this,Fe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=O(this,Fe);Ze.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=O(this,Fe);return Ze.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ze.batch(()=>O(this,Fe).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(vt).catch(vt)}invalidateQueries(e,t={}){return Ze.batch(()=>(O(this,Fe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ze.batch(()=>O(this,Fe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(vt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=O(this,Fe).build(this,t);return r.isStaleByTime(vr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Hs.isOnline()?O(this,kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,Fe)}getMutationCache(){return O(this,kr)}getDefaultOptions(){return O(this,Ar)}setDefaultOptions(e){G(this,Ar,e)}setQueryDefaults(e,t){O(this,zn).set(Qn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,zn).values()],r={};return t.forEach(n=>{Yn(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){O(this,Hn).set(Qn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,Hn).values()],r={};return t.forEach(n=>{Yn(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,Ar).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ao(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,Ar).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,Fe).clear(),O(this,kr).clear()}},Fe=new WeakMap,kr=new WeakMap,Ar=new WeakMap,zn=new WeakMap,Hn=new WeakMap,Pr=new WeakMap,qn=new WeakMap,Wn=new WeakMap,zh),kl=be.createContext(void 0),wp=e=>{const t=be.useContext(kl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sp=({client:e,children:t})=>(be.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(kl.Provider,{value:e,children:t})),Al=be.createContext(!1),Cp=()=>be.useContext(Al);Al.Provider;function Ep(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Op=be.createContext(Ep()),Dp=()=>be.useContext(Op),Tp=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?wl(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Ip=e=>{be.useEffect(()=>{e.clearReset()},[e])},Np=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||wl(r,[e.error,n])),xp=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kp=(e,t)=>e.isLoading&&e.isFetching&&!t,Ap=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Pl=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Pp(e,t,r){var g,b,h,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Cp(),s=Dp(),i=wp(),o=i.defaultQueryOptions(e);(b=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,o);const a=i.getQueryCache().get(o.queryHash);process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;o._optimisticResults=n?"isRestoring":c?"optimistic":void 0,xp(o),Tp(o,s,a),Ip(s);const u=!i.getQueryCache().get(o.queryHash),[d]=be.useState(()=>new t(i,o)),f=d.getOptimisticResult(o),y=!n&&c;if(be.useSyncExternalStore(be.useCallback(m=>{const _=y?d.subscribe(Ze.batchCalls(m)):vt;return d.updateResult(),_},[d,y]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),be.useEffect(()=>{d.setOptions(o)},[o,d]),Ap(o,f))throw Pl(o,d,s);if(Np({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw f.error;if((v=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,o,f),o.experimental_prefetchInRender&&!Rn.isServer()&&kp(f,n)){const m=u?Pl(o,d,s):a==null?void 0:a.promise;m==null||m.catch(vt).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?f:d.trackResult(f)}function Ml(e,t){return Pp(e,hp)}let Mp={data:""},Lp=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Mp},Fp=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,$p=/\/\*[^]*?\*\/| +/g,Ll=/\n+/g,mr=(e,t)=>{let r="",n="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+o+";":n+=i[1]=="f"?mr(o,i):i+"{"+mr(o,i[1]=="k"?"":t)+"}":typeof o=="object"?n+=mr(o,t?t.replace(/([^,])+/g,a=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):i):o!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=mr.p?mr.p(i,o):i+":"+o+";")}return r+(t&&s?t+"{"+s+"}":s)+n},br={},Fl=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Fl(e[r]);return t}return e},Bp=(e,t,r,n,s)=>{let i=Fl(e),o=br[i]||(br[i]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(i));if(!br[o]){let c=i!==e?e:(u=>{let d,f,y=[{}];for(;d=Fp.exec(u.replace($p,""));)d[4]?y.shift():d[3]?(f=d[3].replace(Ll," ").trim(),y.unshift(y[0][f]=y[0][f]||{})):y[0][d[1]]=d[2].replace(Ll," ").trim();return y[0]})(e);br[o]=mr(s?{["@keyframes "+o]:c}:c,r?"":"."+o)}let a=r&&br.g;return r&&(br.g=br[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(br[o],t,n,a),o},jp=(e,t,r)=>e.reduce((n,s,i)=>{let o=t[i];if(o&&o.call){let a=o(r),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=c?"."+c:a&&typeof a=="object"?a.props?"":mr(a,""):a===!1?"":a}return n+s+(o??"")},"");function Ws(e){let t=this||{},r=e.call?e(t.p):e;return Bp(r.unshift?r.raw?jp(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,Lp(t.target),t.g,t.o,t.k)}let $l,vo,mo;Ws.bind({g:1});let cr=Ws.bind({k:1});function Vp(e,t,r,n){mr.p=t,$l=e,vo=r,mo=n}function _r(e,t){let r=this||{};return function(){let n=arguments;function s(i,o){let a=Object.assign({},i),c=a.className||s.className;r.p=Object.assign({theme:vo&&vo()},a),r.o=/go\d/.test(c),a.className=Ws.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=a.as||e,delete a.as),mo&&u[0]&&mo(a),$l(u,a)}return s}}var Up=e=>typeof e=="function",Ks=(e,t)=>Up(e)?e(t):e,zp=(()=>{let e=0;return()=>(++e).toString()})(),Bl=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Hp=20,bo="default",jl=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return jl(e,{type:e.toasts.find(o=>o.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Gs=[],Vl={toasts:[],pausedAt:void 0,settings:{toastLimit:Hp}},Jt={},Ul=(e,t=bo)=>{Jt[t]=jl(Jt[t]||Vl,e),Gs.forEach(([r,n])=>{r===t&&n(Jt[t])})},zl=e=>Object.keys(Jt).forEach(t=>Ul(e,t)),qp=e=>Object.keys(Jt).find(t=>Jt[t].toasts.some(r=>r.id===e)),Qs=(e=bo)=>t=>{Ul(t,e)},Wp={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Kp=(e={},t=bo)=>{let[r,n]=p.useState(Jt[t]||Vl),s=p.useRef(Jt[t]);p.useEffect(()=>(s.current!==Jt[t]&&n(Jt[t]),Gs.push([t,n]),()=>{let o=Gs.findIndex(([a])=>a===t);o>-1&&Gs.splice(o,1)}),[t]);let i=r.toasts.map(o=>{var a,c,u;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((a=e[o.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((c=e[o.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||Wp[o.type],style:{...e.style,...(u=e[o.type])==null?void 0:u.style,...o.style}}});return{...r,toasts:i}},Gp=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||zp()}),Xn=e=>(t,r)=>{let n=Gp(t,e,r);return Qs(n.toasterId||qp(n.id))({type:2,toast:n}),n.id},je=(e,t)=>Xn("blank")(e,t);je.error=Xn("error"),je.success=Xn("success"),je.loading=Xn("loading"),je.custom=Xn("custom"),je.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Qs(t)(r):zl(r)},je.dismissAll=e=>je.dismiss(void 0,e),je.remove=(e,t)=>{let r={type:4,toastId:e};t?Qs(t)(r):zl(r)},je.removeAll=e=>je.remove(void 0,e),je.promise=(e,t,r)=>{let n=je.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Ks(t.success,s):void 0;return i?je.success(i,{id:n,...r,...r==null?void 0:r.success}):je.dismiss(n),s}).catch(s=>{let i=t.error?Ks(t.error,s):void 0;i?je.error(i,{id:n,...r,...r==null?void 0:r.error}):je.dismiss(n)}),e};var Qp=1e3,Yp=(e,t="default")=>{let{toasts:r,pausedAt:n}=Kp(e,t),s=p.useRef(new Map).current,i=p.useCallback((f,y=Qp)=>{if(s.has(f))return;let g=setTimeout(()=>{s.delete(f),o({type:4,toastId:f})},y);s.set(f,g)},[]);p.useEffect(()=>{if(n)return;let f=Date.now(),y=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(f-g.createdAt);if(b<0){g.visible&&je.dismiss(g.id);return}return setTimeout(()=>je.dismiss(g.id,t),b)});return()=>{y.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let o=p.useCallback(Qs(t),[t]),a=p.useCallback(()=>{o({type:5,time:Date.now()})},[o]),c=p.useCallback((f,y)=>{o({type:1,toast:{id:f,height:y}})},[o]),u=p.useCallback(()=>{n&&o({type:6,time:Date.now()})},[n,o]),d=p.useCallback((f,y)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:h}=y||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),m=v.findIndex(S=>S.id===f.id),_=v.filter((S,w)=>w<m&&S.visible).length;return v.filter(S=>S.visible).slice(...g?[_+1]:[0,_]).reduce((S,w)=>S+(w.height||0)+b,0)},[r]);return p.useEffect(()=>{r.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let y=s.get(f.id);y&&(clearTimeout(y),s.delete(f.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:a,endPause:u,calculateOffset:d}}},Rp=cr`
|
|
2
|
+
from {
|
|
3
|
+
transform: scale(0) rotate(45deg);
|
|
4
|
+
opacity: 0;
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: scale(1) rotate(45deg);
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}`,Xp=cr`
|
|
10
|
+
from {
|
|
11
|
+
transform: scale(0);
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
transform: scale(1);
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}`,Zp=cr`
|
|
18
|
+
from {
|
|
19
|
+
transform: scale(0) rotate(90deg);
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
transform: scale(1) rotate(90deg);
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}`,Jp=_r("div")`
|
|
26
|
+
width: 20px;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
height: 20px;
|
|
29
|
+
border-radius: 10px;
|
|
30
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
31
|
+
position: relative;
|
|
32
|
+
transform: rotate(45deg);
|
|
33
|
+
|
|
34
|
+
animation: ${Rp} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
35
|
+
forwards;
|
|
36
|
+
animation-delay: 100ms;
|
|
37
|
+
|
|
38
|
+
&:after,
|
|
39
|
+
&:before {
|
|
40
|
+
content: '';
|
|
41
|
+
animation: ${Xp} 0.15s ease-out forwards;
|
|
42
|
+
animation-delay: 150ms;
|
|
43
|
+
position: absolute;
|
|
44
|
+
border-radius: 3px;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
background: ${e=>e.secondary||"#fff"};
|
|
47
|
+
bottom: 9px;
|
|
48
|
+
left: 4px;
|
|
49
|
+
height: 2px;
|
|
50
|
+
width: 12px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:before {
|
|
54
|
+
animation: ${Zp} 0.15s ease-out forwards;
|
|
55
|
+
animation-delay: 180ms;
|
|
56
|
+
transform: rotate(90deg);
|
|
57
|
+
}
|
|
58
|
+
`,eg=cr`
|
|
59
|
+
from {
|
|
60
|
+
transform: rotate(0deg);
|
|
61
|
+
}
|
|
62
|
+
to {
|
|
63
|
+
transform: rotate(360deg);
|
|
64
|
+
}
|
|
65
|
+
`,tg=_r("div")`
|
|
66
|
+
width: 12px;
|
|
67
|
+
height: 12px;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
border: 2px solid;
|
|
70
|
+
border-radius: 100%;
|
|
71
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
72
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
73
|
+
animation: ${eg} 1s linear infinite;
|
|
74
|
+
`,rg=cr`
|
|
75
|
+
from {
|
|
76
|
+
transform: scale(0) rotate(45deg);
|
|
77
|
+
opacity: 0;
|
|
78
|
+
}
|
|
79
|
+
to {
|
|
80
|
+
transform: scale(1) rotate(45deg);
|
|
81
|
+
opacity: 1;
|
|
82
|
+
}`,ng=cr`
|
|
83
|
+
0% {
|
|
84
|
+
height: 0;
|
|
85
|
+
width: 0;
|
|
86
|
+
opacity: 0;
|
|
87
|
+
}
|
|
88
|
+
40% {
|
|
89
|
+
height: 0;
|
|
90
|
+
width: 6px;
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
100% {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
height: 10px;
|
|
96
|
+
}`,sg=_r("div")`
|
|
97
|
+
width: 20px;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
height: 20px;
|
|
100
|
+
border-radius: 10px;
|
|
101
|
+
background: ${e=>e.primary||"#61d345"};
|
|
102
|
+
position: relative;
|
|
103
|
+
transform: rotate(45deg);
|
|
104
|
+
|
|
105
|
+
animation: ${rg} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
106
|
+
forwards;
|
|
107
|
+
animation-delay: 100ms;
|
|
108
|
+
&:after {
|
|
109
|
+
content: '';
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
animation: ${ng} 0.2s ease-out forwards;
|
|
112
|
+
opacity: 0;
|
|
113
|
+
animation-delay: 200ms;
|
|
114
|
+
position: absolute;
|
|
115
|
+
border-right: 2px solid;
|
|
116
|
+
border-bottom: 2px solid;
|
|
117
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
118
|
+
bottom: 6px;
|
|
119
|
+
left: 6px;
|
|
120
|
+
height: 10px;
|
|
121
|
+
width: 6px;
|
|
122
|
+
}
|
|
123
|
+
`,ig=_r("div")`
|
|
124
|
+
position: absolute;
|
|
125
|
+
`,og=_r("div")`
|
|
126
|
+
position: relative;
|
|
127
|
+
display: flex;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
align-items: center;
|
|
130
|
+
min-width: 20px;
|
|
131
|
+
min-height: 20px;
|
|
132
|
+
`,ag=cr`
|
|
133
|
+
from {
|
|
134
|
+
transform: scale(0.6);
|
|
135
|
+
opacity: 0.4;
|
|
136
|
+
}
|
|
137
|
+
to {
|
|
138
|
+
transform: scale(1);
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}`,lg=_r("div")`
|
|
141
|
+
position: relative;
|
|
142
|
+
transform: scale(0.6);
|
|
143
|
+
opacity: 0.4;
|
|
144
|
+
min-width: 20px;
|
|
145
|
+
animation: ${ag} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
146
|
+
forwards;
|
|
147
|
+
`,cg=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?be.createElement(lg,null,t):t:r==="blank"?null:be.createElement(og,null,be.createElement(tg,{...n}),r!=="loading"&&be.createElement(ig,null,r==="error"?be.createElement(Jp,{...n}):be.createElement(sg,{...n})))},ug=e=>`
|
|
148
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
149
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
150
|
+
`,dg=e=>`
|
|
151
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
152
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
153
|
+
`,fg="0%{opacity:0;} 100%{opacity:1;}",hg="0%{opacity:1;} 100%{opacity:0;}",pg=_r("div")`
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
background: #fff;
|
|
157
|
+
color: #363636;
|
|
158
|
+
line-height: 1.3;
|
|
159
|
+
will-change: transform;
|
|
160
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
161
|
+
max-width: 350px;
|
|
162
|
+
pointer-events: auto;
|
|
163
|
+
padding: 8px 10px;
|
|
164
|
+
border-radius: 8px;
|
|
165
|
+
`,gg=_r("div")`
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
margin: 4px 10px;
|
|
169
|
+
color: inherit;
|
|
170
|
+
flex: 1 1 auto;
|
|
171
|
+
white-space: pre-line;
|
|
172
|
+
`,yg=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=Bl()?[fg,hg]:[ug(r),dg(r)];return{animation:t?`${cr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${cr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},vg=be.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?yg(e.position||t||"top-center",e.visible):{opacity:0},i=be.createElement(cg,{toast:e}),o=be.createElement(gg,{...e.ariaProps},Ks(e.message,e));return be.createElement(pg,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:i,message:o}):be.createElement(be.Fragment,null,i,o))});Vp(be.createElement);var mg=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let i=be.useCallback(o=>{if(o){let a=()=>{let c=o.getBoundingClientRect().height;n(e,c)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return be.createElement("div",{ref:i,className:t,style:r},s)},bg=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Bl()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},_g=Ws`
|
|
173
|
+
z-index: 9999;
|
|
174
|
+
> * {
|
|
175
|
+
pointer-events: auto;
|
|
176
|
+
}
|
|
177
|
+
`,Ys=16,wg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:i,containerStyle:o,containerClassName:a})=>{let{toasts:c,handlers:u}=Yp(r,i);return be.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Ys,left:Ys,right:Ys,bottom:Ys,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(d=>{let f=d.position||t,y=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),g=bg(f,y);return be.createElement(mg,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?_g:"",style:g},d.type==="custom"?Ks(d.message,d):s?s(d):be.createElement(vg,{toast:d,position:f}))}))},ht=je;function Sg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const Rs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ln(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _o(e){return"nodeType"in e}function pt(e){var t,r;return e?ln(e)?e:_o(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function wo(e){const{Document:t}=pt(e);return e instanceof t}function Zn(e){return ln(e)?!1:e instanceof pt(e).HTMLElement}function Hl(e){return e instanceof pt(e).SVGElement}function cn(e){return e?ln(e)?e.document:_o(e)?wo(e)?e:Zn(e)||Hl(e)?e.ownerDocument:document:document:document}const zt=Rs?p.useLayoutEffect:p.useEffect;function Xs(e){const t=p.useRef(e);return zt(()=>{t.current=e}),p.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function Cg(){const e=p.useRef(null),t=p.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Jn(e,t){t===void 0&&(t=[e]);const r=p.useRef(e);return zt(()=>{r.current!==e&&(r.current=e)},t),r}function es(e,t){const r=p.useRef();return p.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Zs(e){const t=Xs(e),r=p.useRef(null),n=p.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Js(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let So={};function ts(e,t){return p.useMemo(()=>{if(t)return t;const r=So[e]==null?0:So[e]+1;return So[e]=r,e+"-"+r},[e,t])}function ql(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((i,o)=>{const a=Object.entries(o);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const un=ql(1),rs=ql(-1);function Eg(e){return"clientX"in e&&"clientY"in e}function ei(e){if(!e)return!1;const{KeyboardEvent:t}=pt(e.target);return t&&e instanceof t}function Og(e){if(!e)return!1;const{TouchEvent:t}=pt(e.target);return t&&e instanceof t}function ti(e){if(Og(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Eg(e)?{x:e.clientX,y:e.clientY}:null}const wr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[wr.Translate.toString(e),wr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Wl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Dg(e){return e.matches(Wl)?e:e.querySelector(Wl)}const Tg={display:"none"};function Ig(e){let{id:t,value:r}=e;return p.createElement("div",{id:t,style:Tg},r)}function Ng(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return p.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function xg(){const[e,t]=p.useState("");return{announce:p.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Kl=p.createContext(null);function kg(e){const t=p.useContext(Kl);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ag(){const[e]=p.useState(()=>new Set),t=p.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[p.useCallback(n=>{let{type:s,event:i}=n;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const Pg={draggable:`
|
|
178
|
+
To pick up a draggable item, press the space bar.
|
|
179
|
+
While dragging, use the arrow keys to move the item.
|
|
180
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
181
|
+
`},Mg={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Lg(e){let{announcements:t=Mg,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Pg}=e;const{announce:i,announcement:o}=xg(),a=ts("DndLiveRegion"),[c,u]=p.useState(!1);if(p.useEffect(()=>{u(!0)},[]),kg(p.useMemo(()=>({onDragStart(f){let{active:y}=f;i(t.onDragStart({active:y}))},onDragMove(f){let{active:y,over:g}=f;t.onDragMove&&i(t.onDragMove({active:y,over:g}))},onDragOver(f){let{active:y,over:g}=f;i(t.onDragOver({active:y,over:g}))},onDragEnd(f){let{active:y,over:g}=f;i(t.onDragEnd({active:y,over:g}))},onDragCancel(f){let{active:y,over:g}=f;i(t.onDragCancel({active:y,over:g}))}}),[i,t])),!c)return null;const d=p.createElement(p.Fragment,null,p.createElement(Ig,{id:n,value:s.draggable}),p.createElement(Ng,{id:a,announcement:o}));return r?Be.createPortal(d,r):d}var qe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(qe||(qe={}));function ri(){}function Co(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Gl(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Ht=Object.freeze({x:0,y:0});function Ql(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Fg(e,t){const r=ti(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function Yl(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function $g(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Rl(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function Xl(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Zl(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Bg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Zl(t,t.left,t.top),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=Ql(Zl(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(Yl)},jg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Rl(t),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=Rl(c),d=s.reduce((y,g,b)=>y+Ql(u[b],g),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:f}})}}return i.sort(Yl)};function Vg(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-n,a=i-r;if(n<s&&r<i){const c=t.width*t.height,u=e.width*e.height,d=o*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const Ug=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const i of n){const{id:o}=i,a=r.get(o);if(a){const c=Vg(a,t);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort($g)};function zg(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Jl(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ht}function Hg(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...r})}}const qg=Hg(1);function ec(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Wg(e,t,r){const n=ec(t);if(!n)return e;const{scaleX:s,scaleY:i,x:o,y:a}=n,c=e.left-o-(1-s)*parseFloat(r),u=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const Kg={ignoreTransform:!1};function dn(e,t){t===void 0&&(t=Kg);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=pt(e).getComputedStyle(e);u&&(r=Wg(r,u,d))}const{top:n,left:s,width:i,height:o,bottom:a,right:c}=r;return{top:n,left:s,width:i,height:o,bottom:a,right:c}}function tc(e){return dn(e,{ignoreTransform:!0})}function Gg(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Qg(e,t){return t===void 0&&(t=pt(e).getComputedStyle(e)),t.position==="fixed"}function Yg(e,t){t===void 0&&(t=pt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?r.test(i):!1})}function ni(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(wo(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Zn(s)||Hl(s)||r.includes(s))return r;const i=pt(e).getComputedStyle(s);return s!==e&&Yg(s,i)&&r.push(s),Qg(s,i)?r:n(s.parentNode)}return e?n(e):r}function rc(e){const[t]=ni(e,1);return t??null}function Eo(e){return!Rs||!e?null:ln(e)?e:_o(e)?wo(e)||e===cn(e).scrollingElement?window:Zn(e)?e:null:null}function nc(e){return ln(e)?e.scrollX:e.scrollLeft}function sc(e){return ln(e)?e.scrollY:e.scrollTop}function Oo(e){return{x:nc(e),y:sc(e)}}var Ke;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ke||(Ke={}));function ic(e){return!Rs||!e?!1:e===document.scrollingElement}function oc(e){const t={x:0,y:0},r=ic(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:n,minScroll:t}}const Rg={x:.2,y:.2};function Xg(e,t,r,n,s){let{top:i,left:o,right:a,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=Rg);const{isTop:u,isBottom:d,isLeft:f,isRight:y}=oc(e),g={x:0,y:0},b={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&i<=t.top+h.height?(g.y=Ke.Backward,b.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&c>=t.bottom-h.height&&(g.y=Ke.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!y&&a>=t.right-h.width?(g.x=Ke.Forward,b.x=n*Math.abs((t.right-h.width-a)/h.width)):!f&&o<=t.left+h.width&&(g.x=Ke.Backward,b.x=n*Math.abs((t.left+h.width-o)/h.width)),{direction:g,speed:b}}function Zg(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function ac(e){return e.reduce((t,r)=>un(t,Oo(r)),Ht)}function Jg(e){return e.reduce((t,r)=>t+nc(r),0)}function ey(e){return e.reduce((t,r)=>t+sc(r),0)}function lc(e,t){if(t===void 0&&(t=dn),!e)return;const{top:r,left:n,bottom:s,right:i}=t(e);rc(e)&&(s<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ty=[["x",["left","right"],Jg],["y",["top","bottom"],ey]];class Do{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ni(r),s=ac(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of ty)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(n),d=s[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ns{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function ry(e){const{EventTarget:t}=pt(e);return e instanceof t?e:cn(e)}function To(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Mt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Mt||(Mt={}));function cc(e){e.preventDefault()}function ny(e){e.stopPropagation()}var ge;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ge||(ge={}));const uc={start:[ge.Space,ge.Enter],cancel:[ge.Esc],end:[ge.Space,ge.Enter,ge.Tab]},sy=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case ge.Right:return{...r,x:r.x+25};case ge.Left:return{...r,x:r.x-25};case ge.Down:return{...r,y:r.y+25};case ge.Up:return{...r,y:r.y-25}}};class Io{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new ns(cn(r)),this.windowListeners=new ns(pt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Mt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&lc(n),r(Ht)}handleKeyDown(t){if(ei(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:i=uc,coordinateGetter:o=sy,scrollBehavior:a="smooth"}=s,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:Ht;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:r,context:n.current,currentCoordinates:d});if(f){const y=rs(f,d),g={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:m,isRight:_,isLeft:S,isBottom:w,maxScroll:C,minScroll:D}=oc(h),x=Zg(h),A={x:Math.min(v===ge.Right?x.right-x.width/2:x.right,Math.max(v===ge.Right?x.left:x.left+x.width/2,f.x)),y:Math.min(v===ge.Down?x.bottom-x.height/2:x.bottom,Math.max(v===ge.Down?x.top:x.top+x.height/2,f.y))},B=v===ge.Right&&!_||v===ge.Left&&!S,P=v===ge.Down&&!w||v===ge.Up&&!m;if(B&&A.x!==f.x){const F=h.scrollLeft+y.x,q=v===ge.Right&&F<=C.x||v===ge.Left&&F>=D.x;if(q&&!y.y){h.scrollTo({left:F,behavior:a});return}q?g.x=h.scrollLeft-F:g.x=v===ge.Right?h.scrollLeft-C.x:h.scrollLeft-D.x,g.x&&h.scrollBy({left:-g.x,behavior:a});break}else if(P&&A.y!==f.y){const F=h.scrollTop+y.y,q=v===ge.Down&&F<=C.y||v===ge.Up&&F>=D.y;if(q&&!y.x){h.scrollTo({top:F,behavior:a});return}q?g.y=h.scrollTop-F:g.y=v===ge.Down?h.scrollTop-C.y:h.scrollTop-D.y,g.y&&h.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,un(rs(f,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Io.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=uc,onActivation:s}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function dc(e){return!!(e&&"distance"in e)}function fc(e){return!!(e&&"delay"in e)}class No{constructor(t,r,n){var s;n===void 0&&(n=ry(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=cn(o),this.documentListeners=new ns(this.document),this.listeners=new ns(n),this.windowListeners=new ns(pt(o)),this.initialCoordinates=(s=ti(i))!=null?s:Ht,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Mt.Resize,this.handleCancel),this.windowListeners.add(Mt.DragStart,cc),this.windowListeners.add(Mt.VisibilityChange,this.handleCancel),this.windowListeners.add(Mt.ContextMenu,cc),this.documentListeners.add(Mt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(dc(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Mt.Click,ny,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Mt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(r=ti(t))!=null?r:Ht,u=rs(s,c);if(!n&&a){if(dc(a)){if(a.tolerance!=null&&To(u,a.tolerance))return this.handleCancel();if(To(u,a.distance))return this.handleStart()}if(fc(a)&&To(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),o(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===ge.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const iy={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class si extends No{constructor(t){const{event:r}=t,n=cn(r.target);super(t,iy,n)}}si.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const oy={move:{name:"mousemove"},end:{name:"mouseup"}};var xo;(function(e){e[e.RightClick=2]="RightClick"})(xo||(xo={}));class ay extends No{constructor(t){super(t,oy,cn(t.event.target))}}ay.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===xo.RightClick?!1:(n==null||n({event:r}),!0)}}];const ko={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ly extends No{constructor(t){super(t,ko)}static setup(){return window.addEventListener(ko.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ko.move.name,t)};function t(){}}}ly.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var ss;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ss||(ss={}));var ii;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ii||(ii={}));function cy(e){let{acceleration:t,activator:r=ss.Pointer,canScroll:n,draggingRect:s,enabled:i,interval:o=5,order:a=ii.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:y}=e;const g=dy({delta:f,disabled:!i}),[b,h]=Cg(),v=p.useRef({x:0,y:0}),m=p.useRef({x:0,y:0}),_=p.useMemo(()=>{switch(r){case ss.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ss.DraggableRect:return s}},[r,s,c]),S=p.useRef(null),w=p.useCallback(()=>{const D=S.current;if(!D)return;const x=v.current.x*m.current.x,A=v.current.y*m.current.y;D.scrollBy(x,A)},[]),C=p.useMemo(()=>a===ii.TreeOrder?[...u].reverse():u,[a,u]);p.useEffect(()=>{if(!i||!u.length||!_){h();return}for(const D of C){if((n==null?void 0:n(D))===!1)continue;const x=u.indexOf(D),A=d[x];if(!A)continue;const{direction:B,speed:P}=Xg(D,A,_,t,y);for(const F of["x","y"])g[F][B[F]]||(P[F]=0,B[F]=0);if(P.x>0||P.y>0){h(),S.current=D,b(w,o),v.current=P,m.current=B;return}}v.current={x:0,y:0},m.current={x:0,y:0},h()},[t,w,n,h,i,o,JSON.stringify(_),JSON.stringify(g),b,u,C,d,JSON.stringify(y)])}const uy={x:{[Ke.Backward]:!1,[Ke.Forward]:!1},y:{[Ke.Backward]:!1,[Ke.Forward]:!1}};function dy(e){let{delta:t,disabled:r}=e;const n=Js(t);return es(s=>{if(r||!n||!s)return uy;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Ke.Backward]:s.x[Ke.Backward]||i.x===-1,[Ke.Forward]:s.x[Ke.Forward]||i.x===1},y:{[Ke.Backward]:s.y[Ke.Backward]||i.y===-1,[Ke.Forward]:s.y[Ke.Forward]||i.y===1}}},[r,t,n])}function fy(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return es(s=>{var i;return t==null?null:(i=n??s)!=null?i:null},[n,t])}function hy(e,t){return p.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var is;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(is||(is={}));var Ao;(function(e){e.Optimized="optimized"})(Ao||(Ao={}));const hc=new Map;function py(e,t){let{dragging:r,dependencies:n,config:s}=t;const[i,o]=p.useState(null),{frequency:a,measure:c,strategy:u}=s,d=p.useRef(e),f=v(),y=Jn(f),g=p.useCallback(function(m){m===void 0&&(m=[]),!y.current&&o(_=>_===null?m:_.concat(m.filter(S=>!_.includes(S))))},[y]),b=p.useRef(null),h=es(m=>{if(f&&!r)return hc;if(!m||m===hc||d.current!==e||i!=null){const _=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){_.set(S.id,S.rect.current);continue}const w=S.node.current,C=w?new Do(c(w),w):null;S.rect.current=C,C&&_.set(S.id,C)}return _}return m},[e,i,r,f,c]);return p.useEffect(()=>{d.current=e},[e]),p.useEffect(()=>{f||g()},[r,f]),p.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),p.useEffect(()=>{f||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},a))},[a,f,g,...n]),{droppableRects:h,measureDroppableContainers:g,measuringScheduled:i!=null};function v(){switch(u){case is.Always:return!1;case is.BeforeDragging:return r;default:return!r}}}function Po(e,t){return es(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function gy(e,t){return Po(e,t)}function yy(e){let{callback:t,disabled:r}=e;const n=Xs(t),s=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function oi(e){let{callback:t,disabled:r}=e;const n=Xs(t),s=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function vy(e){return new Do(dn(e),e)}function pc(e,t,r){t===void 0&&(t=vy);const[n,s]=p.useState(null);function i(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=yy({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=oi({callback:i});return zt(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),n}function my(e){const t=Po(e);return Jl(e,t)}const gc=[];function by(e){const t=p.useRef(e),r=es(n=>e?n&&n!==gc&&e&&t.current&&e.parentNode===t.current.parentNode?n:ni(e):gc,[e]);return p.useEffect(()=>{t.current=e},[e]),r}function _y(e){const[t,r]=p.useState(null),n=p.useRef(e),s=p.useCallback(i=>{const o=Eo(i.target);o&&r(a=>a?(a.set(o,Oo(o)),new Map(a)):null)},[]);return p.useEffect(()=>{const i=n.current;if(e!==i){o(i);const a=e.map(c=>{const u=Eo(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Oo(u)]):null}).filter(c=>c!=null);r(a.length?new Map(a):null),n.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(c=>{const u=Eo(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>un(i,o),Ht):ac(e):Ht,[e,t])}function yc(e,t){t===void 0&&(t=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},t),p.useEffect(()=>{const n=e!==Ht;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?rs(e,r.current):Ht}function wy(e){p.useEffect(()=>{if(!Rs)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Sy(e,t){return p.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:i}=n;return r[s]=o=>{i(o,t)},r},{}),[e,t])}function vc(e){return p.useMemo(()=>e?Gg(e):null,[e])}const mc=[];function Cy(e,t){t===void 0&&(t=dn);const[r]=e,n=vc(r?pt(r):null),[s,i]=p.useState(mc);function o(){i(()=>e.length?e.map(c=>ic(c)?n:new Do(t(c),c)):mc)}const a=oi({callback:o});return zt(()=>{a==null||a.disconnect(),o(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function bc(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Zn(t)?t:e}function Ey(e){let{measure:t}=e;const[r,n]=p.useState(null),s=p.useCallback(u=>{for(const{target:d}of u)if(Zn(d)){n(f=>{const y=t(d);return f?{...f,width:y.width,height:y.height}:y});break}},[t]),i=oi({callback:s}),o=p.useCallback(u=>{const d=bc(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,c]=Zs(o);return p.useMemo(()=>({nodeRef:a,rect:r,setRef:c}),[r,a,c])}const Oy=[{sensor:si,options:{}},{sensor:Io,options:{}}],Dy={current:{}},ai={draggable:{measure:tc},droppable:{measure:tc,strategy:is.WhileDragging,frequency:Ao.Optimized},dragOverlay:{measure:dn}};class os extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Ty={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new os,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ri},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ai,measureDroppableContainers:ri,windowRect:null,measuringScheduled:!1},_c={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ri,draggableNodes:new Map,over:null,measureDroppableContainers:ri},as=p.createContext(_c),wc=p.createContext(Ty);function Iy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new os}}}function Ny(e,t){switch(t.type){case qe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case qe.DragEnd:case qe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qe.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new os(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case qe.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new os(e.droppable.containers);return o.set(r,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case qe.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const i=new os(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function xy(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=p.useContext(as),i=Js(n),o=Js(r==null?void 0:r.id);return p.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!ei(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=Dg(d);if(f){f.focus();break}}})}},[n,t,s,o,i]),null}function Sc(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...n}),r):r}function ky(e){return p.useMemo(()=>({draggable:{...ai.draggable,...e==null?void 0:e.draggable},droppable:{...ai.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ai.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ay(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const i=p.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;zt(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=Jl(d,n);if(o||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const y=rc(u);y&&y.scrollBy({top:f.y,left:f.x})}},[t,o,a,n,r])}const li=p.createContext({...Ht,scaleX:1,scaleY:1});var Sr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Sr||(Sr={}));const Cc=p.memo(function(t){var r,n,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Oy,collisionDetection:f=Ug,measuring:y,modifiers:g,...b}=t;const h=p.useReducer(Ny,void 0,Iy),[v,m]=h,[_,S]=Ag(),[w,C]=p.useState(Sr.Uninitialized),D=w===Sr.Initialized,{draggable:{active:x,nodes:A,translate:B},droppable:{containers:P}}=v,F=x!=null?A.get(x):null,q=p.useRef({initial:null,translated:null}),k=p.useMemo(()=>{var Xe;return x!=null?{id:x,data:(Xe=F==null?void 0:F.data)!=null?Xe:Dy,rect:q}:null},[x,F]),L=p.useRef(null),[$,ee]=p.useState(null),[R,H]=p.useState(null),te=Jn(b,Object.values(b)),ae=ts("DndDescribedBy",o),W=p.useMemo(()=>P.getEnabled(),[P]),J=ky(y),{droppableRects:Y,measureDroppableContainers:se,measuringScheduled:ue}=py(W,{dragging:D,dependencies:[B.x,B.y],config:J.droppable}),X=fy(A,x),we=p.useMemo(()=>R?ti(R):null,[R]),Pe=an(),We=gy(X,J.draggable.measure);Ay({activeNode:x!=null?A.get(x):null,config:Pe.layoutShiftCompensation,initialRect:We,measure:J.draggable.measure});const ve=pc(X,J.draggable.measure,We),Xt=pc(X?X.parentElement:null),$e=p.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=P.getNodeFor((r=$e.current.over)==null?void 0:r.id),dt=Ey({measure:J.dragOverlay.measure}),He=(n=dt.nodeRef.current)!=null?n:X,re=D?(s=dt.rect)!=null?s:ve:null,Re=!!(dt.nodeRef.current&&dt.rect),wt=my(Re?null:ve),At=vc(He?pt(He):null),St=by(D?kt??X:null),hr=Cy(St),Vt=Sc(g,{transform:{x:B.x-wt.x,y:B.y-wt.y,scaleX:1,scaleY:1},activatorEvent:R,active:k,activeNodeRect:ve,containerNodeRect:Xt,draggingNodeRect:re,over:$e.current.over,overlayNodeRect:dt.rect,scrollableAncestors:St,scrollableAncestorRects:hr,windowRect:At}),to=we?un(we,B):null,il=_y(St),Hh=yc(il),ro=yc(il,[ve]),E=un(Vt,Hh),I=re?qg(re,Vt):null,N=k&&I?f({active:k,collisionRect:I,droppableRects:Y,droppableContainers:W,pointerCoordinates:to}):null,j=Xl(N,"id"),[V,K]=p.useState(null),U=Re?Vt:un(Vt,ro),Z=zg(U,(i=V==null?void 0:V.rect)!=null?i:null,ve),ce=p.useRef(null),Me=p.useCallback((Xe,ft)=>{let{sensor:yt,options:Zt}=ft;if(L.current==null)return;const Ut=A.get(L.current);if(!Ut)return;const Pt=Xe.nativeEvent,ar=new yt({active:L.current,activeNode:Ut,event:Pt,options:Zt,context:$e,onAbort(rt){if(!A.get(rt))return;const{onDragAbort:lr}=te.current,gr={id:rt};lr==null||lr(gr),_({type:"onDragAbort",event:gr})},onPending(rt,Mr,lr,gr){if(!A.get(rt))return;const{onDragPending:js}=te.current,Lr={id:rt,constraint:Mr,initialCoordinates:lr,offset:gr};js==null||js(Lr),_({type:"onDragPending",event:Lr})},onStart(rt){const Mr=L.current;if(Mr==null)return;const lr=A.get(Mr);if(!lr)return;const{onDragStart:gr}=te.current,Bs={activatorEvent:Pt,active:{id:Mr,data:lr.data,rect:q}};Be.unstable_batchedUpdates(()=>{gr==null||gr(Bs),C(Sr.Initializing),m({type:qe.DragStart,initialCoordinates:rt,active:Mr}),_({type:"onDragStart",event:Bs}),ee(ce.current),H(Pt)})},onMove(rt){m({type:qe.DragMove,coordinates:rt})},onEnd:Kn(qe.DragEnd),onCancel:Kn(qe.DragCancel)});ce.current=ar;function Kn(rt){return async function(){const{active:lr,collisions:gr,over:Bs,scrollAdjustedTranslate:js}=$e.current;let Lr=null;if(lr&&js){const{cancelDrop:Vs}=te.current;Lr={activatorEvent:Pt,active:lr,collisions:gr,delta:js,over:Bs},rt===qe.DragEnd&&typeof Vs=="function"&&await Promise.resolve(Vs(Lr))&&(rt=qe.DragCancel)}L.current=null,Be.unstable_batchedUpdates(()=>{m({type:rt}),C(Sr.Uninitialized),K(null),ee(null),H(null),ce.current=null;const Vs=rt===qe.DragEnd?"onDragEnd":"onDragCancel";if(Lr){const ol=te.current[Vs];ol==null||ol(Lr),_({type:Vs,event:Lr})}})}}},[A]),Ct=p.useCallback((Xe,ft)=>(yt,Zt)=>{const Ut=yt.nativeEvent,Pt=A.get(Zt);if(L.current!==null||!Pt||Ut.dndKit||Ut.defaultPrevented)return;const ar={active:Pt};Xe(yt,ft.options,ar)===!0&&(Ut.dndKit={capturedBy:ft.sensor},L.current=Zt,Me(yt,ft))},[A,Me]),Et=hy(d,Ct);wy(d),zt(()=>{ve&&w===Sr.Initializing&&C(Sr.Initialized)},[ve,w]),p.useEffect(()=>{const{onDragMove:Xe}=te.current,{active:ft,activatorEvent:yt,collisions:Zt,over:Ut}=$e.current;if(!ft||!yt)return;const Pt={active:ft,activatorEvent:yt,collisions:Zt,delta:{x:E.x,y:E.y},over:Ut};Be.unstable_batchedUpdates(()=>{Xe==null||Xe(Pt),_({type:"onDragMove",event:Pt})})},[E.x,E.y]),p.useEffect(()=>{const{active:Xe,activatorEvent:ft,collisions:yt,droppableContainers:Zt,scrollAdjustedTranslate:Ut}=$e.current;if(!Xe||L.current==null||!ft||!Ut)return;const{onDragOver:Pt}=te.current,ar=Zt.get(j),Kn=ar&&ar.rect.current?{id:ar.id,rect:ar.rect.current,data:ar.data,disabled:ar.disabled}:null,rt={active:Xe,activatorEvent:ft,collisions:yt,delta:{x:Ut.x,y:Ut.y},over:Kn};Be.unstable_batchedUpdates(()=>{K(Kn),Pt==null||Pt(rt),_({type:"onDragOver",event:rt})})},[j]),zt(()=>{$e.current={activatorEvent:R,active:k,activeNode:X,collisionRect:I,collisions:N,droppableRects:Y,draggableNodes:A,draggingNode:He,draggingNodeRect:re,droppableContainers:P,over:V,scrollableAncestors:St,scrollAdjustedTranslate:E},q.current={initial:re,translated:I}},[k,X,N,I,A,He,re,Y,P,V,St,E]),cy({...Pe,delta:B,draggingRect:I,pointerCoordinates:to,scrollableAncestors:St,scrollableAncestorRects:hr});const pr=p.useMemo(()=>({active:k,activeNode:X,activeNodeRect:ve,activatorEvent:R,collisions:N,containerNodeRect:Xt,dragOverlay:dt,draggableNodes:A,droppableContainers:P,droppableRects:Y,over:V,measureDroppableContainers:se,scrollableAncestors:St,scrollableAncestorRects:hr,measuringConfiguration:J,measuringScheduled:ue,windowRect:At}),[k,X,ve,R,N,Xt,dt,A,P,Y,V,se,St,hr,J,ue,At]),$s=p.useMemo(()=>({activatorEvent:R,activators:Et,active:k,activeNodeRect:ve,ariaDescribedById:{draggable:ae},dispatch:m,draggableNodes:A,over:V,measureDroppableContainers:se}),[R,Et,k,ve,m,ae,A,V,se]);return p.createElement(Kl.Provider,{value:S},p.createElement(as.Provider,{value:$s},p.createElement(wc.Provider,{value:pr},p.createElement(li.Provider,{value:Z},u)),p.createElement(xy,{disabled:(a==null?void 0:a.restoreFocus)===!1})),p.createElement(Lg,{...a,hiddenTextDescribedById:ae}));function an(){const Xe=($==null?void 0:$.autoScrollEnabled)===!1,ft=typeof c=="object"?c.enabled===!1:c===!1,yt=D&&!Xe&&!ft;return typeof c=="object"?{...c,enabled:yt}:{enabled:yt}}}),Py=p.createContext(null),Ec="button",My="Draggable";function Oc(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const i=ts(My),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:y}=p.useContext(as),{role:g=Ec,roleDescription:b="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,m=p.useContext(v?li:Py),[_,S]=Zs(),[w,C]=Zs(),D=Sy(o,t),x=Jn(r);zt(()=>(f.set(t,{id:t,key:i,node:_,activatorNode:w,data:x}),()=>{const B=f.get(t);B&&B.key===i&&f.delete(t)}),[f,t]);const A=p.useMemo(()=>({role:g,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&g===Ec?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,g,h,v,b,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:A,isDragging:v,listeners:n?void 0:D,node:_,over:y,setNodeRef:S,setActivatorNodeRef:C,transform:m}}function Dc(){return p.useContext(wc)}const Ly="Droppable",Fy={timeout:25};function $y(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const i=ts(Ly),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=p.useContext(as),d=p.useRef({disabled:r}),f=p.useRef(!1),y=p.useRef(null),g=p.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...Fy,...s},m=Jn(h??n),_=p.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),g.current=null},v)},[v]),S=oi({callback:_,disabled:b||!o}),w=p.useCallback((A,B)=>{S&&(B&&(S.unobserve(B),f.current=!1),A&&S.observe(A))},[S]),[C,D]=Zs(w),x=Jn(t);return p.useEffect(()=>{!S||!C.current||(S.disconnect(),f.current=!1,S.observe(C.current))},[C,S]),p.useEffect(()=>(a({type:qe.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:y,data:x}}),()=>a({type:qe.UnregisterDroppable,key:i,id:n})),[n]),p.useEffect(()=>{r!==d.current.disabled&&(a({type:qe.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:o,rect:y,isOver:(c==null?void 0:c.id)===n,node:C,over:c,setNodeRef:D}}function By(e){let{animation:t,children:r}=e;const[n,s]=p.useState(null),[i,o]=p.useState(null),a=Js(r);return!r&&!n&&a&&s(a),zt(()=>{if(!i)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,i)).then(()=>{s(null)})},[t,n,i]),p.createElement(p.Fragment,null,r,n?p.cloneElement(n,{ref:o}):null)}const jy={x:0,y:0,scaleX:1,scaleY:1};function Vy(e){let{children:t}=e;return p.createElement(as.Provider,{value:_c},p.createElement(li.Provider,{value:jy},t))}const Uy={position:"fixed",touchAction:"none"},zy=e=>ei(e)?"transform 250ms ease":void 0,Hy=p.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:i,className:o,rect:a,style:c,transform:u,transition:d=zy}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},y={...Uy,width:a.width,height:a.height,top:a.top,left:a.left,transform:wr.Transform.toString(f),transformOrigin:s&&n?Fg(n,a):void 0,transition:typeof d=="function"?d(n):d,...c};return p.createElement(r,{className:o,style:y,ref:t},i)}),qy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:wr.Transform.toString(t)},{transform:wr.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&n.node.style.setProperty(a,c);return o!=null&&o.active&&r.node.classList.add(o.active),o!=null&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(s))r.node.style.setProperty(c,u);o!=null&&o.active&&r.node.classList.remove(o.active)}})({styles:{active:{opacity:"0"}}})};function Wy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return Xs((i,o)=>{if(t===null)return;const a=r.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=bc(o);if(!u)return;const{transform:d}=pt(o).getComputedStyle(o),f=ec(d);if(!f)return;const y=typeof t=="function"?t:Ky(t);return lc(c,s.draggable.measure),y({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function Ky(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...qy,...e};return i=>{let{active:o,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},y={x:c.x-d.x,y:c.y-d.y,...f},g=s({...u,active:o,dragOverlay:a,transform:{initial:c,final:y}}),[b]=g,h=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:o,dragOverlay:a,...u}),m=a.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(_=>{m.onfinish=()=>{v==null||v(),_()}})}}let Tc=0;function Gy(e){return p.useMemo(()=>{if(e!=null)return Tc++,Tc},[e])}const Qy=p.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:y,containerNodeRect:g,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:m,measuringConfiguration:_,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:C}=Dc(),D=p.useContext(li),x=Gy(f==null?void 0:f.id),A=Sc(o,{activatorEvent:d,active:f,activeNodeRect:y,containerNodeRect:g,draggingNodeRect:v.rect,over:m,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:D,windowRect:C}),B=Po(y),P=Wy({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:_}),F=B?v.setRef:void 0;return p.createElement(Vy,null,p.createElement(By,{animation:P},f&&x?p.createElement(Hy,{key:x,id:f.id,ref:F,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:B,style:{zIndex:u,...s},transform:A},r):null))});/**
|
|
182
|
+
* @license lucide-react v0.400.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const Yy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ic=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
|
|
187
|
+
* @license lucide-react v0.400.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/var Ry={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
192
|
+
* @license lucide-react v0.400.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const Xy=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},c)=>p.createElement("svg",{ref:c,...Ry,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ic("lucide",s),...a},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
|
|
197
|
+
* @license lucide-react v0.400.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const ie=(e,t)=>{const r=p.forwardRef(({className:n,...s},i)=>p.createElement(Xy,{ref:i,iconNode:t,className:Ic(`lucide-${Yy(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
202
|
+
* @license lucide-react v0.400.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const Zy=ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
207
|
+
* @license lucide-react v0.400.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const Jy=ie("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
|
|
212
|
+
* @license lucide-react v0.400.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const fn=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
217
|
+
* @license lucide-react v0.400.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const ls=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
222
|
+
* @license lucide-react v0.400.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const Nc=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
227
|
+
* @license lucide-react v0.400.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const ev=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
232
|
+
* @license lucide-react v0.400.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const xc=ie("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
237
|
+
* @license lucide-react v0.400.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const Mo=ie("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
242
|
+
* @license lucide-react v0.400.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const Lo=ie("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
247
|
+
* @license lucide-react v0.400.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const tv=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
252
|
+
* @license lucide-react v0.400.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const rv=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
257
|
+
* @license lucide-react v0.400.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const kc=ie("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
|
|
262
|
+
* @license lucide-react v0.400.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const Fo=ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
267
|
+
* @license lucide-react v0.400.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const hn=ie("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
272
|
+
* @license lucide-react v0.400.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const nv=ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
277
|
+
* @license lucide-react v0.400.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const Ac=ie("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
282
|
+
* @license lucide-react v0.400.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const Pc=ie("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
287
|
+
* @license lucide-react v0.400.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const sv=ie("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
292
|
+
* @license lucide-react v0.400.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const Mc=ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
297
|
+
* @license lucide-react v0.400.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const $o=ie("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
302
|
+
* @license lucide-react v0.400.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const iv=ie("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
307
|
+
* @license lucide-react v0.400.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const ci=ie("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
|
|
312
|
+
* @license lucide-react v0.400.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const ov=ie("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
317
|
+
* @license lucide-react v0.400.0 - ISC
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the ISC license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const av=ie("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
322
|
+
* @license lucide-react v0.400.0 - ISC
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the ISC license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const Bo=ie("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
|
|
327
|
+
* @license lucide-react v0.400.0 - ISC
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the ISC license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const jo=ie("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
332
|
+
* @license lucide-react v0.400.0 - ISC
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the ISC license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const lv=ie("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
337
|
+
* @license lucide-react v0.400.0 - ISC
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the ISC license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const cv=ie("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
342
|
+
* @license lucide-react v0.400.0 - ISC
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the ISC license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const uv=ie("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
|
|
347
|
+
* @license lucide-react v0.400.0 - ISC
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the ISC license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/const dv=ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
352
|
+
* @license lucide-react v0.400.0 - ISC
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the ISC license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/const cs=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
357
|
+
* @license lucide-react v0.400.0 - ISC
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the ISC license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/const Lc=ie("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
|
|
362
|
+
* @license lucide-react v0.400.0 - ISC
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the ISC license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/const fv=ie("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
367
|
+
* @license lucide-react v0.400.0 - ISC
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the ISC license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/const hv=ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
372
|
+
* @license lucide-react v0.400.0 - ISC
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the ISC license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/const Vo=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
377
|
+
* @license lucide-react v0.400.0 - ISC
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the ISC license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/const pv=ie("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
382
|
+
* @license lucide-react v0.400.0 - ISC
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the ISC license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/const gv=ie("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
387
|
+
* @license lucide-react v0.400.0 - ISC
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the ISC license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/const yv=ie("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
392
|
+
* @license lucide-react v0.400.0 - ISC
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the ISC license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/const Uo=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
397
|
+
* @license lucide-react v0.400.0 - ISC
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the ISC license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/const Fc=ie("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
402
|
+
* @license lucide-react v0.400.0 - ISC
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the ISC license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/const vv=ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
407
|
+
* @license lucide-react v0.400.0 - ISC
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the ISC license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/const zo=ie("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
|
|
412
|
+
* @license lucide-react v0.400.0 - ISC
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the ISC license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const Br=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),mv={},$c=e=>{let t;const r=new Set,n=(d,f)=>{const y=typeof d=="function"?d(t):d;if(!Object.is(y,t)){const g=t;t=f??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(b=>b(t,g))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(mv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,s,c);return c},bv=e=>e?$c(e):$c;function Bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ho={exports:{}},qo={},ui={exports:{}},Wo={};/**
|
|
417
|
+
* @license React
|
|
418
|
+
* use-sync-external-store-shim.production.js
|
|
419
|
+
*
|
|
420
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
421
|
+
*
|
|
422
|
+
* This source code is licensed under the MIT license found in the
|
|
423
|
+
* LICENSE file in the root directory of this source tree.
|
|
424
|
+
*/var jc;function _v(){if(jc)return Wo;jc=1;var e=p;function t(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(f,y){var g=y(),b=n({inst:{value:g,getSnapshot:y}}),h=b[0].inst,v=b[1];return i(function(){h.value=g,h.getSnapshot=y,c(h)&&v({inst:h})},[f,g,y]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),o(g),g}function c(f){var y=f.getSnapshot;f=f.value;try{var g=y();return!r(f,g)}catch{return!0}}function u(f,y){return y()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Wo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Wo}var Ko={};/**
|
|
425
|
+
* @license React
|
|
426
|
+
* use-sync-external-store-shim.development.js
|
|
427
|
+
*
|
|
428
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the MIT license found in the
|
|
431
|
+
* LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/var Vc;function wv(){return Vc||(Vc=1,process.env.NODE_ENV!=="production"&&function(){function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}function t(g,b){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=b();if(!f){var v=b();i(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=o({inst:{value:h,getSnapshot:b}});var m=v[0].inst,_=v[1];return c(function(){m.value=h,m.getSnapshot=b,r(m)&&_({inst:m})},[g,h,b]),a(function(){return r(m)&&_({inst:m}),g(function(){r(m)&&_({inst:m})})},[g]),u(h),h}function r(g){var b=g.getSnapshot;g=g.value;try{var h=b();return!i(g,h)}catch{return!0}}function n(g,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=p,i=typeof Object.is=="function"?Object.is:e,o=s.useState,a=s.useEffect,c=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Ko.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ko}var Uc;function Go(){return Uc||(Uc=1,process.env.NODE_ENV==="production"?ui.exports=_v():ui.exports=wv()),ui.exports}/**
|
|
433
|
+
* @license React
|
|
434
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
435
|
+
*
|
|
436
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the MIT license found in the
|
|
439
|
+
* LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/var zc;function Sv(){if(zc)return qo;zc=1;var e=p,t=Go();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,c=e.useDebugValue;return qo.useSyncExternalStoreWithSelector=function(u,d,f,y,g){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function m(D){if(!_){if(_=!0,S=D,D=y(D),g!==void 0&&h.hasValue){var x=h.value;if(g(x,D))return w=x}return w=D}if(x=w,n(S,D))return x;var A=y(D);return g!==void 0&&g(x,A)?(S=D,x):(S=D,w=A)}var _=!1,S,w,C=f===void 0?null:f;return[function(){return m(d())},C===null?void 0:function(){return m(C())}]},[d,f,y,g]);var v=s(u,b[0],b[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},qo}var Qo={};/**
|
|
441
|
+
* @license React
|
|
442
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
443
|
+
*
|
|
444
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the MIT license found in the
|
|
447
|
+
* LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/var Hc;function Cv(){return Hc||(Hc=1,process.env.NODE_ENV!=="production"&&function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=Go(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,c=t.useDebugValue;Qo.useSyncExternalStoreWithSelector=function(u,d,f,y,g){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function m(D){if(!_){if(_=!0,S=D,D=y(D),g!==void 0&&h.hasValue){var x=h.value;if(g(x,D))return w=x}return w=D}if(x=w,n(S,D))return x;var A=y(D);return g!==void 0&&g(x,A)?(S=D,x):(S=D,w=A)}var _=!1,S,w,C=f===void 0?null:f;return[function(){return m(d())},C===null?void 0:function(){return m(C())}]},[d,f,y,g]);var v=s(u,b[0],b[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Qo}process.env.NODE_ENV==="production"?Ho.exports=Sv():Ho.exports=Cv();var Ev=Ho.exports;const Ov=Bc(Ev),qc={},{useDebugValue:Dv}=p,{useSyncExternalStoreWithSelector:Tv}=Ov;let Wc=!1;const Iv=e=>e;function Nv(e,t=Iv,r){(qc?"production":void 0)!=="production"&&r&&!Wc&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Wc=!0);const n=Tv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Dv(n),n}const Kc=e=>{(qc?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?bv(e):e,r=(n,s)=>Nv(t,n,s);return Object.assign(r,t),r},di=e=>e?Kc(e):Kc,Ee=di(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sendBackCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),Gc=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:Ee},Symbol.toStringTag,{value:"Module"}));function pn(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function Qc(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const i=Qc(s.children,t,r+1);if(i>=0)return i}}return-1}const xv=new Set(["name","appIcon","description","keywords","trackable"]);function Yc(e,t,r){return e.map(n=>{if(n.id===t){const s=r.metadata??{},i={};for(const o of xv)o in r&&(i[o]=r[o]);return{...n,...r,metadata:{...n.metadata??{},...i,...s}}}return n.children&&n.children.length>0?{...n,children:Yc(n.children,t,r)}:n})}function fi(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:fi(n.children,t,r)}:n)}function Yo(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Yo(r.children,t):[]}))}function Rc(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]],[o]=i.splice(r,1);return i.splice(n,0,o),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:Rc(s.children,t,r,n)}:s})}function kv(e,t){const r=pn(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?pn(e,s.parent):void 0;return n}const Ie=di((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:i}=t(),o=pn(n,r),a=i(r),c={...(o==null?void 0:o.metadata)??{},...s[r]??{}};Ee.getState().setNodeFlags({isFolder:(o==null?void 0:o.isFolder)??!1,isRoot:!(o!=null&&o.parent),isQuml:!1}),e({selectedNodeId:r,breadcrumb:a,activeNodeMeta:c})},updateNode:(r,n)=>{e(s=>({treeData:Yc(s.treeData,r,n),treeCache:{...s.treeCache,[r]:{...s.treeCache[r]??{},...n}}})),Ee.getState().setIsDirty(!0)},addNode:(r,n)=>{var u,d;const s=t(),i=((d=(u=Ee.getState().editorConfig)==null?void 0:u.config)==null?void 0:d.maxDepth)??4,o=Qc(s.treeData,r);if(o>=i-1)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${i}). parentDepth=${o}`),"";const a="temp-"+Math.random().toString(36).slice(2),c={id:a,identifier:a,name:"Untitled Unit",isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:a,name:"Untitled Unit",visibility:"Parent"}};return e(f=>({treeData:fi(f.treeData,r,c),treeCache:{...f.treeCache,[a]:{...c.metadata,isNew:!0}}})),t().selectNode(a),a},deleteNode:r=>{e(n=>({treeData:Yo(n.treeData,r),selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}))},reorderChildren:(r,n,s)=>{e(i=>({treeData:Rc(i.treeData,r,n,s)}))},moveNode:(r,n,s)=>{e(i=>{const o=pn(i.treeData,r);if(!o)return i;let a=Yo(i.treeData,r);return a=fi(a,s,{...o,parent:s}),{treeData:a,isDirty:!0}})},addResource:(r,n)=>{var c,u;const s=Ee.getState().editorConfig,i=((c=s==null?void 0:s.config)==null?void 0:c.allowContentUnderRoot)??!1,o=(u=t().treeData[0])==null?void 0:u.id;if(!i&&n===o)return;const a={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:r};e(d=>({treeData:fi(d.treeData,n,a)})),t().markDirty()},markDirty:()=>{Promise.resolve().then(()=>Gc).then(({useEditorStore:r})=>{r.getState().setIsDirty(!0)})},getNodeById:r=>pn(t().treeData,r),getChildrenOf:r=>{const n=pn(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>kv(t().treeData,r)})),Av=di(e=>({activeModal:null,modalData:{},openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}})})),Pv={spin:"_spin_1ah4d_9"},Mv=({size:e=16,color:t="currentColor"})=>l.jsx("svg",{className:Pv.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":"Loading",role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})}),Ne=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:i,className:o,type:a="button"})=>l.jsxs("button",{type:a,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${o??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(Mv,{size:14}):null,i]});function Xc(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lv}=Object.prototype,{getPrototypeOf:gn}=Object,{iterator:us,toStringTag:Zc}=Symbol,hi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ds=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),hi(r,t))return!0;r=gn(r)}return!1},Fv=(e,t)=>e!=null&&ds(e,t)?e[t]:void 0,Ro=(e=>t=>{const r=Lv.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),qt=e=>(e=e.toLowerCase(),t=>Ro(t)===e),pi=e=>t=>typeof t===e,{isArray:jr}=Array,yn=pi("undefined");function vn(e){return e!==null&&!yn(e)&&e.constructor!==null&&!yn(e.constructor)&&mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Jc=qt("ArrayBuffer");function $v(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Jc(e.buffer),t}const Bv=pi("string"),mt=pi("function"),eu=pi("number"),mn=e=>e!==null&&typeof e=="object",jv=e=>e===!0||e===!1,gi=e=>{if(!mn(e))return!1;const t=gn(e);return(t===null||t===Object.prototype||gn(t)===null)&&!ds(e,Zc)&&!ds(e,us)},Vv=e=>{if(!mn(e)||vn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Uv=qt("Date"),zv=qt("File"),Hv=e=>!!(e&&typeof e.uri<"u"),qv=e=>e&&typeof e.getParts<"u",Wv=qt("Blob"),Kv=qt("FileList"),Gv=e=>mn(e)&&mt(e.pipe);function Qv(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const tu=Qv(),ru=typeof tu.FormData<"u"?tu.FormData:void 0,Yv=e=>{if(!e)return!1;if(ru&&e instanceof ru)return!0;const t=gn(e);if(!t||t===Object.prototype||!mt(e.append))return!1;const r=Ro(e);return r==="formdata"||r==="object"&&mt(e.toString)&&e.toString()==="[object FormData]"},Rv=qt("URLSearchParams"),[Xv,Zv,Jv,em]=["ReadableStream","Request","Response","Headers"].map(qt),tm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function fs(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),jr(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(vn(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function nu(e,t){if(vn(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,su=e=>!yn(e)&&e!==Vr;function Xo(...e){const{caseless:t,skipUndefined:r}=su(this)&&this||{},n={},s=(i,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const a=t&&typeof o=="string"&&nu(n,o)||o,c=hi(n,a)?n[a]:void 0;gi(c)&&gi(i)?n[a]=Xo(c,i):gi(i)?n[a]=Xo({},i):jr(i)?n[a]=i.slice():(!r||!yn(i))&&(n[a]=i)};for(let i=0,o=e.length;i<o;i++){const a=e[i];if(!a||vn(a)||(fs(a,s),typeof a!="object"||jr(a)))continue;const c=Object.getOwnPropertySymbols(a);for(let u=0;u<c.length;u++){const d=c[u];hm.call(a,d)&&s(a[d],d)}}return n}const rm=(e,t,r,{allOwnKeys:n}={})=>(fs(t,(s,i)=>{r&&mt(s)?Object.defineProperty(e,i,{__proto__:null,value:Xc(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),nm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},im=(e,t,r,n)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&gn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},om=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},am=e=>{if(!e)return null;if(jr(e))return e;let t=e.length;if(!eu(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},lm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&gn(Uint8Array)),cm=(e,t)=>{const n=(e&&e[us]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},um=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},dm=qt("HTMLFormElement"),fm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:hm}=Object.prototype,pm=qt("RegExp"),iu=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};fs(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},gm=e=>{iu(e,(t,r)=>{if(mt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(mt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ym=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return jr(e)?n(e):n(String(e).split(t)),r},vm=()=>{},mm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bm(e){return!!(e&&mt(e.append)&&e[Zc]==="FormData"&&e[us])}const _m=e=>{const t=new WeakSet,r=n=>{if(mn(n)){if(t.has(n))return;if(vn(n))return n;if(!("toJSON"in n)){t.add(n);const s=jr(n)?[]:{};return fs(n,(i,o)=>{const a=r(i);!yn(a)&&(s[o]=a)}),t.delete(n),s}}return n};return r(e)},wm=qt("AsyncFunction"),Sm=e=>e&&(mn(e)||mt(e))&&mt(e.then)&&mt(e.catch),ou=((e,t)=>e?setImmediate:t?((r,n)=>(Vr.addEventListener("message",({source:s,data:i})=>{s===Vr&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),Vr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",mt(Vr.postMessage)),Cm=typeof queueMicrotask<"u"?queueMicrotask.bind(Vr):typeof process<"u"&&process.nextTick||ou,au=e=>e!=null&&mt(e[us]),T={isArray:jr,isArrayBuffer:Jc,isBuffer:vn,isFormData:Yv,isArrayBufferView:$v,isString:Bv,isNumber:eu,isBoolean:jv,isObject:mn,isPlainObject:gi,isEmptyObject:Vv,isReadableStream:Xv,isRequest:Zv,isResponse:Jv,isHeaders:em,isUndefined:yn,isDate:Uv,isFile:zv,isReactNativeBlob:Hv,isReactNative:qv,isBlob:Wv,isRegExp:pm,isFunction:mt,isStream:Gv,isURLSearchParams:Rv,isTypedArray:lm,isFileList:Kv,forEach:fs,merge:Xo,extend:rm,trim:tm,stripBOM:nm,inherits:sm,toFlatObject:im,kindOf:Ro,kindOfTest:qt,endsWith:om,toArray:am,forEachEntry:cm,matchAll:um,isHTMLForm:dm,hasOwnProperty:hi,hasOwnProp:hi,hasOwnInPrototypeChain:ds,getSafeProp:Fv,reduceDescriptors:iu,freezeMethods:gm,toObjectSet:ym,toCamelCase:fm,noop:vm,toFiniteNumber:mm,findKey:nu,global:Vr,isContextDefined:su,isSpecCompliantForm:bm,toJSONObject:_m,isAsyncFn:wm,isThenable:Sm,setImmediate:ou,asap:Cm,isIterable:au,isSafeIterable:e=>e!=null&&ds(e,us)&&au(e)},Em=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Om=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
449
|
+
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Em[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function Dm(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const Tm=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Im=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Zo(e,t){return T.isArray(e)?e.map(r=>Zo(r,t)):Dm(String(e).replace(t,""))}const Nm=e=>Zo(e,Tm),xm=e=>Zo(e,Im);function lu(e){const t=Object.create(null);return T.forEach(e.toJSON(),(r,n)=>{t[n]=xm(r)}),t}const cu=Symbol("internals");function hs(e){return e&&String(e).trim().toLowerCase()}function yi(e){return e===!1||e==null?e:T.isArray(e)?e.map(yi):Nm(String(e))}function km(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Am=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jo(e,t,r,n,s){if(T.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!T.isString(t)){if(T.isString(n))return t.indexOf(n)!==-1;if(T.isRegExp(n))return n.test(t)}}function Pm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Mm(e,t){const r=T.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}let nt=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(a,c,u){const d=hs(c);if(!d)return;const f=T.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=yi(a))}const o=(a,c)=>T.forEach(a,(u,d)=>i(u,d,c));if(T.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(T.isString(t)&&(t=t.trim())&&!Am(t))o(Om(t),r);else if(T.isObject(t)&&T.isSafeIterable(t)){let a=Object.create(null),c,u;for(const d of t){if(!T.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],T.hasOwnProp(a,u)?(c=a[u],a[u]=T.isArray(c)?[...c,d[1]]:[c,d[1]]):a[u]=d[1]}o(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=hs(t),t){const n=T.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return km(s);if(T.isFunction(r))return r.call(this,s,n);if(T.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=hs(t),t){const n=T.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Jo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(o){if(o=hs(o),o){const a=T.findKey(n,o);a&&(!r||Jo(n,n[a],a,r))&&(delete n[a],s=!0)}}return T.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||Jo(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return T.forEach(this,(s,i)=>{const o=T.findKey(n,i);if(o){r[o]=yi(s),delete r[i];return}const a=t?Pm(i):String(i).trim();a!==i&&delete r[i],r[a]=yi(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return T.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&T.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
450
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[cu]=this[cu]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=hs(o);n[a]||(Mm(s,o),n[a]=!0)}return T.isArray(t)?t.forEach(i):i(t),this}};nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(nt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),T.freezeMethods(nt);const Lm="[REDACTED ****]";function Fm(e){if(T.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(T.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function $m(e,t){const r=new Set(t.map(i=>String(i).toLowerCase())),n=[],s=i=>{if(i===null||typeof i!="object"||T.isBuffer(i))return i;if(n.indexOf(i)!==-1)return;i instanceof nt&&(i=i.toJSON()),n.push(i);let o;if(T.isArray(i))o=[],i.forEach((a,c)=>{const u=s(a);T.isUndefined(u)||(o[c]=u)});else{if(!T.isPlainObject(i)&&Fm(i))return n.pop(),i;o=Object.create(null);for(const[a,c]of Object.entries(i)){const u=r.has(a.toLowerCase())?Lm:s(c);T.isUndefined(u)||(o[a]=u)}}return n.pop(),o};return s(e)}let Q=class Gh extends Error{static from(t,r,n,s,i,o){const a=new Gh(t.message,r||t.code,n,s,i);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),o&&Object.assign(a,o),a}constructor(t,r,n,s,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,r=t&&T.hasOwnProp(t,"redact")?t.redact:void 0,n=T.isArray(r)&&r.length>0?$m(t,r):T.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};Q.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Q.ERR_BAD_OPTION="ERR_BAD_OPTION",Q.ECONNABORTED="ECONNABORTED",Q.ETIMEDOUT="ETIMEDOUT",Q.ECONNREFUSED="ECONNREFUSED",Q.ERR_NETWORK="ERR_NETWORK",Q.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Q.ERR_DEPRECATED="ERR_DEPRECATED",Q.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Q.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Q.ERR_CANCELED="ERR_CANCELED",Q.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Q.ERR_INVALID_URL="ERR_INVALID_URL",Q.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Bm=null,uu=100;function ea(e){return T.isPlainObject(e)||T.isArray(e)}function du(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function ta(e,t,r){return e?e.concat(t).map(function(s,i){return s=du(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function jm(e){return T.isArray(e)&&!e.some(ea)}const Vm=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function vi(e,t,r){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=T.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,S){return!T.isUndefined(S[_])});const n=r.metaTokens,s=r.visitor||b,i=r.dots,o=r.indexes,a=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?uu:r.maxDepth,u=a&&T.isSpecCompliantForm(t),d=[];if(!T.isFunction(s))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(T.isDate(m))return m.toISOString();if(T.isBoolean(m))return m.toString();if(!u&&T.isBlob(m))throw new Q("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(m)||T.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function y(m){if(m>c)throw new Q("Object is too deeply nested ("+m+" levels). Max depth: "+c,Q.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(m,_){if(c===1/0)return JSON.stringify(m);const S=[];return JSON.stringify(m,function(C,D){if(!T.isObject(D))return D;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(D),y(_+S.length-1),D})}function b(m,_,S){let w=m;if(T.isReactNative(t)&&T.isReactNativeBlob(m))return t.append(ta(S,_,i),f(m)),!1;if(m&&!S&&typeof m=="object"){if(T.endsWith(_,"{}"))_=n?_:_.slice(0,-2),m=g(m,1);else if(T.isArray(m)&&jm(m)||(T.isFileList(m)||T.endsWith(_,"[]"))&&(w=T.toArray(m)))return _=du(_),w.forEach(function(D,x){!(T.isUndefined(D)||D===null)&&t.append(o===!0?ta([_],x,i):o===null?_:_+"[]",f(D))}),!1}return ea(m)?!0:(t.append(ta(S,_,i),f(m)),!1)}const h=Object.assign(Vm,{defaultVisitor:b,convertValue:f,isVisitable:ea});function v(m,_,S=0){if(!T.isUndefined(m)){if(y(S),d.indexOf(m)!==-1)throw new Error("Circular reference detected in "+_.join("."));d.push(m),T.forEach(m,function(C,D){(!(T.isUndefined(C)||C===null)&&s.call(t,C,T.isString(D)?D.trim():D,_,h))===!0&&v(C,_?_.concat(D):[D],S+1)}),d.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return v(e),t}function fu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function ra(e,t){this._pairs=[],e&&vi(e,this,t)}const hu=ra.prototype;hu.append=function(t,r){this._pairs.push([t,r])},hu.toString=function(t){const r=t?function(n){return t.call(this,n,fu)}:fu;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Um(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function pu(e,t,r){if(!t)return e;const n=T.isFunction(r)?{serialize:r}:r,s=T.getSafeProp(n,"encode")||Um,i=T.getSafeProp(n,"serialize");let o;if(i?o=i(t,n):o=T.isURLSearchParams(t)?t.toString():new ra(t,n).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class gu{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(n){n!==null&&t(n)})}}const na={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},zm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ra,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sa=typeof window<"u"&&typeof document<"u",ia=typeof navigator=="object"&&navigator||void 0,Hm=sa&&(!ia||["ReactNative","NativeScript","NS"].indexOf(ia.product)<0),qm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wm=sa&&window.location.href||"http://localhost",Je={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sa,hasStandardBrowserEnv:Hm,hasStandardBrowserWebWorkerEnv:qm,navigator:ia,origin:Wm},Symbol.toStringTag,{value:"Module"})),...zm};function Km(e,t){return vi(e,new Je.classes.URLSearchParams,{visitor:function(r,n,s,i){return Je.isNode&&T.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}const yu=uu;function vu(e){if(e>yu)throw new Q("FormData field is too deeply nested ("+e+" levels). Max depth: "+yu,Q.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Gm(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)vu(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Qm(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function mu(e){function t(r,n,s,i){vu(i);let o=r[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=r.length;return o=!o&&T.isArray(s)?s.length:o,c?(T.hasOwnProp(s,o)?s[o]=T.isArray(s[o])?s[o].concat(n):[s[o],n]:s[o]=n,!a):((!T.hasOwnProp(s,o)||!T.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&T.isArray(s[o])&&(s[o]=Qm(s[o])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const r={};return T.forEachEntry(e,(n,s)=>{t(Gm(n),s,r,0)}),r}return null}const bn=(e,t)=>e!=null&&T.hasOwnProp(e,t)?e[t]:void 0;function Ym(e,t,r){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ps={transitional:na,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=T.isObject(t);if(i&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return s?JSON.stringify(mu(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){const c=bn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Km(t,c).toString();if((a=T.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=bn(this,"env"),d=u&&u.FormData;return vi(a?{"files[]":t}:t,d&&new d,c)}}return i||s?(r.setContentType("application/json",!1),Ym(t)):t}],transformResponse:[function(t){const r=bn(this,"transitional")||ps.transitional,n=r&&r.forcedJSONParsing,s=bn(this,"responseType"),i=s==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(n&&!s||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,bn(this,"parseReviver"))}catch(c){if(a)throw c.name==="SyntaxError"?Q.from(c,Q.ERR_BAD_RESPONSE,this,null,bn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch","query"],e=>{ps.headers[e]={}});function oa(e,t){const r=this||ps,n=t||r,s=nt.from(n.headers);let i=n.data;return T.forEach(e,function(a){i=a.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function bu(e){return!!(e&&e.__CANCEL__)}let gs=class extends Q{constructor(t,r,n){super(t??"canceled",Q.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function _u(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Q("Request failed with status code "+r.status,r.status>=400&&r.status<500?Q.ERR_BAD_REQUEST:Q.ERR_BAD_RESPONSE,r.config,r.request,r))}function Rm(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Xm(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];o||(o=u),r[s]=c,n[s]=u;let f=i,y=0;for(;f!==s;)y+=r[f++],f=f%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const g=d&&u-d;return g?Math.round(y*1e3/g):void 0}}function Zm(e,t){let r=0,n=1e3/t,s,i;const o=(u,d=Date.now())=>{r=d,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?o(u,d):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},n-f)))},()=>s&&o(s)]}const mi=(e,t,r=3)=>{let n=0;const s=Xm(50,250);return Zm(i=>{if(!i||typeof i.loaded!="number")return;const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=a!=null?Math.min(o,a):o,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:a,progress:a?c/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a?(a-c)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},wu=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Su=e=>(...t)=>T.asap(()=>e(...t)),Jm=Je.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Je.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,eb=Je.hasStandardBrowserEnv?{write(e,t,r,n,s,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];T.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),T.isString(n)&&a.push(`path=${n}`),T.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),T.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function tb(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const nb=/^https?:(?!\/\/)/i,sb=/[\t\n\r]/g;function ib(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function ob(e){return ib(e).replace(sb,"")}function Cu(e,t){if(typeof e=="string"&&nb.test(ob(e)))throw new Q('Invalid URL: missing "//" after protocol',Q.ERR_INVALID_URL,t)}function Eu(e,t,r,n){Cu(t,n);let s=!tb(t);return e&&(s||r===!1)?(Cu(e,n),rb(e,t)):t}const Ou=e=>e instanceof nt?{...e}:e;function Ur(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(d,f,y,g){return T.isPlainObject(d)&&T.isPlainObject(f)?T.merge.call({caseless:g},d,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function s(d,f,y,g){if(T.isUndefined(f)){if(!T.isUndefined(d))return n(void 0,d,y,g)}else return n(d,f,y,g)}function i(d,f){if(!T.isUndefined(f))return n(void 0,f)}function o(d,f){if(T.isUndefined(f)){if(!T.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function a(d){const f=T.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!T.isUndefined(f))if(T.isPlainObject(f)){if(T.hasOwnProp(f,d))return f[d]}else return;const y=T.hasOwnProp(e,"transitional")?e.transitional:void 0;if(T.isPlainObject(y)&&T.hasOwnProp(y,d))return y[d]}function c(d,f,y){if(T.hasOwnProp(t,y))return n(d,f);if(T.hasOwnProp(e,y))return n(void 0,d)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(d,f,y)=>s(Ou(d),Ou(f),y,!0)};return T.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const y=T.hasOwnProp(u,f)?u[f]:s,g=T.hasOwnProp(e,f)?e[f]:void 0,b=T.hasOwnProp(t,f)?t[f]:void 0,h=y(g,b,f);T.isUndefined(h)&&y!==c||(r[f]=h)}),T.hasOwnProp(t,"validateStatus")&&T.isUndefined(t.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(T.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const ab=["content-type","content-length"];function lb(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{ab.includes(n.toLowerCase())&&e.set(n,s)})}const cb=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Du(e){const t=Ur({},e),r=y=>T.hasOwnProp(t,y)?t[y]:void 0,n=r("data");let s=r("withXSRFToken");const i=r("xsrfHeaderName"),o=r("xsrfCookieName");let a=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=a=nt.from(a),t.url=pu(Eu(u,f,d,t),r("params"),r("paramsSerializer")),c){const y=T.getSafeProp(c,"username")||"",g=T.getSafeProp(c,"password")||"";a.set("Authorization","Basic "+btoa(y+":"+(g?cb(g):"")))}if(T.isFormData(n)&&(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv||T.isReactNative(n)?a.setContentType(void 0):T.isFunction(n.getHeaders)&&lb(a,n.getHeaders(),r("formDataHeaderPolicy"))),Je.hasStandardBrowserEnv&&(T.isFunction(s)&&(s=s(t)),s===!0||s==null&&Jm(t.url))){const g=i&&o&&eb.read(o);g&&a.set(i,g)}return t}const ub=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=Du(e);let i=s.data;const o=nt.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,d,f,y,g,b;function h(){g&&g(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function m(){if(!v)return;const S=nt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};_u(function(x){r(x),h()},function(x){n(x),h()},C),v=null}"onloadend"in v?v.onloadend=m:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(m)},v.onabort=function(){v&&(n(new Q("Request aborted",Q.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(w){const C=w&&w.message?w.message:"Network Error",D=new Q(C,Q.ERR_NETWORK,e,v);D.event=w||null,n(D),h(),v=null},v.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const C=s.transitional||na;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),n(new Q(w,C.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,v)),h(),v=null},i===void 0&&o.setContentType(null),"setRequestHeader"in v&&T.forEach(lu(o),function(w,C){v.setRequestHeader(C,w)}),T.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),u&&([y,b]=mi(u,!0),v.addEventListener("progress",y)),c&&v.upload&&([f,g]=mi(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new gs(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const _=Rm(s.url);if(_&&!Je.protocols.includes(_)){n(new Q("Unsupported protocol "+_+":",Q.ERR_BAD_REQUEST,e));return}v.send(i||null)})},db=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,o();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Q?u:new gs(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout of ${t}ms exceeded`,Q.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>T.asap(o),a},fb=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},hb=async function*(e,t){for await(const r of pb(e))yield*fb(r,t)},pb=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Tu=(e,t,r,n)=>{const s=hb(e,t);let i=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){a(),c.close();return}let f=d.byteLength;if(r){let y=i+=f;r(y)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},bi=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,gb=(e,t,r)=>t+2<r&&bi(e.charCodeAt(t+1))&&bi(e.charCodeAt(t+2));function yb(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let o=n.length;const a=n.length;for(let g=0;g<a;g++)if(n.charCodeAt(g)===37&&g+2<a){const b=n.charCodeAt(g+1),h=n.charCodeAt(g+2);bi(b)&&bi(h)&&(o-=2,g+=2)}let c=0,u=a-1;const d=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const y=Math.floor(o/4)*3-(c||0);return y>0?y:0}let i=0;for(let o=0,a=n.length;o<a;o++){const c=n.charCodeAt(o);if(c===37&&gb(n,o,a))i+=1,o+=2;else if(c<128)i+=1;else if(c<2048)i+=2;else if(c>=55296&&c<=56319&&o+1<a){const u=n.charCodeAt(o+1);u>=56320&&u<=57343?(i+=4,o++):i+=3}else i+=3}return i}const aa="1.18.0",Iu=64*1024,{isFunction:_i}=T,vb=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Nu=e=>{if(!T.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},xu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},mb=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},bb=e=>{const t=T.global!==void 0&&T.global!==null?T.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=T.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:i,Response:o}=e,a=s?_i(s):typeof fetch=="function",c=_i(i),u=_i(o);if(!a)return!1;const d=a&&_i(r),f=a&&(typeof n=="function"?(m=>_=>m.encode(_))(new n):async m=>new Uint8Array(await new i(m).arrayBuffer())),y=c&&d&&xu(()=>{let m=!1;const _=new i(Je.origin,{body:new r,method:"POST",get duplex(){return m=!0,"half"}}),S=_.headers.has("Content-Type");return _.body!=null&&_.body.cancel(),m&&!S}),g=u&&d&&xu(()=>T.isReadableStream(new o("").body)),b={stream:g&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!b[m]&&(b[m]=(_,S)=>{let w=_&&_[m];if(w)return w.call(_);throw new Q(`Response type '${m}' is not supported`,Q.ERR_NOT_SUPPORT,S)})});const h=async m=>{if(m==null)return 0;if(T.isBlob(m))return m.size;if(T.isSpecCompliantForm(m))return(await new i(Je.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(T.isArrayBufferView(m)||T.isArrayBuffer(m))return m.byteLength;if(T.isURLSearchParams(m)&&(m=m+""),T.isString(m))return(await f(m)).byteLength},v=async(m,_)=>{const S=T.toFiniteNumber(m.getContentLength());return S??h(_)};return async m=>{let{url:_,method:S,data:w,signal:C,cancelToken:D,timeout:x,onDownloadProgress:A,onUploadProgress:B,responseType:P,headers:F,withCredentials:q="same-origin",fetchOptions:k,maxContentLength:L,maxBodyLength:$}=Du(m);const ee=T.isNumber(L)&&L>-1,R=T.isNumber($)&&$>-1,H=X=>T.hasOwnProp(m,X)?m[X]:void 0;let te=s||fetch;P=P?(P+"").toLowerCase():"text";let ae=db([C,D&&D.toAbortSignal()],x),W=null;const J=ae&&ae.unsubscribe&&(()=>{ae.unsubscribe()});let Y,se=null;const ue=()=>new Q("Request body larger than maxBodyLength limit",Q.ERR_BAD_REQUEST,m,W);try{let X;const we=H("auth");if(we){const re=T.getSafeProp(we,"username")||"",Re=T.getSafeProp(we,"password")||"";X={username:re,password:Re}}if(mb(_)){const re=new URL(_,Je.origin);if(!X&&(re.username||re.password)){const Re=Nu(re.username),wt=Nu(re.password);X={username:Re,password:wt}}(re.username||re.password)&&(re.username="",re.password="",_=re.href)}if(X&&(F.delete("authorization"),F.set("Authorization","Basic "+btoa(vb((X.username||"")+":"+(X.password||""))))),ee&&typeof _=="string"&&_.startsWith("data:")&&yb(_)>L)throw new Q("maxContentLength size of "+L+" exceeded",Q.ERR_BAD_RESPONSE,m,W);if(R&&S!=="get"&&S!=="head"){const re=await h(w);if(typeof re=="number"&&isFinite(re)&&(Y=re,re>$))throw ue()}const Pe=R&&(T.isReadableStream(w)||T.isStream(w)),We=(re,Re,wt)=>Tu(re,Iu,At=>{if(R&&At>$)throw se=ue();Re&&Re(At)},wt);if(y&&S!=="get"&&S!=="head"&&(B||Pe)){if(Y=Y??await v(F,w),Y!==0||Pe){let re=new i(_,{method:"POST",body:w,duplex:"half"}),Re;if(T.isFormData(w)&&(Re=re.headers.get("content-type"))&&F.setContentType(Re),re.body){const[wt,At]=B&&wu(Y,mi(Su(B)))||[];w=We(re.body,wt,At)}}}else if(Pe&&!c&&d&&S!=="get"&&S!=="head")w=We(w);else if(Pe&&c&&!y&&S!=="get"&&S!=="head")throw new Q("Stream request bodies are not supported by the current fetch implementation",Q.ERR_NOT_SUPPORT,m,W);T.isString(q)||(q=q?"include":"omit");const ve=c&&"credentials"in i.prototype;if(T.isFormData(w)){const re=F.getContentType();re&&/^multipart\/form-data/i.test(re)&&!/boundary=/i.test(re)&&F.delete("content-type")}F.set("User-Agent","axios/"+aa,!1);const Xt={...k,signal:ae,method:S.toUpperCase(),headers:lu(F.normalize()),body:w,duplex:"half",credentials:ve?q:void 0};W=c&&new i(_,Xt);let $e=await(c?te(W,k):te(_,Xt));const kt=nt.from($e.headers);if(ee){const re=T.toFiniteNumber(kt.getContentLength());if(re!=null&&re>L)throw new Q("maxContentLength size of "+L+" exceeded",Q.ERR_BAD_RESPONSE,m,W)}const dt=g&&(P==="stream"||P==="response");if(g&&$e.body&&(A||ee||dt&&J)){const re={};["status","statusText","headers"].forEach(Vt=>{re[Vt]=$e[Vt]});const Re=T.toFiniteNumber(kt.getContentLength()),[wt,At]=A&&wu(Re,mi(Su(A),!0))||[];let St=0;const hr=Vt=>{if(ee&&(St=Vt,St>L))throw new Q("maxContentLength size of "+L+" exceeded",Q.ERR_BAD_RESPONSE,m,W);wt&&wt(Vt)};$e=new o(Tu($e.body,Iu,hr,()=>{At&&At(),J&&J()}),re)}P=P||"text";let He=await b[T.findKey(b,P)||"text"]($e,m);if(ee&&!g&&!dt){let re;if(He!=null&&(typeof He.byteLength=="number"?re=He.byteLength:typeof He.size=="number"?re=He.size:typeof He=="string"&&(re=typeof n=="function"?new n().encode(He).byteLength:He.length)),typeof re=="number"&&re>L)throw new Q("maxContentLength size of "+L+" exceeded",Q.ERR_BAD_RESPONSE,m,W)}return!dt&&J&&J(),await new Promise((re,Re)=>{_u(re,Re,{data:He,headers:nt.from($e.headers),status:$e.status,statusText:$e.statusText,config:m,request:W})})}catch(X){if(J&&J(),ae&&ae.aborted&&ae.reason instanceof Q){const we=ae.reason;throw we.config=m,W&&(we.request=W),X!==we&&(we.cause=X),we}throw se?(W&&!se.request&&(se.request=W),se):X instanceof Q?(W&&!X.request&&(X.request=W),X):X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,m,W,X&&X.response),{cause:X.cause||X}):Q.from(X,X&&X.code,m,W,X&&X.response)}}},_b=new Map,ku=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,i=[n,s,r];let o=i.length,a=o,c,u,d=_b;for(;a--;)c=i[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:bb(t)),d=u;return u};ku();const la={http:Bm,xhr:ub,fetch:{get:ku}};T.forEach(la,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Au=e=>`- ${e}`,wb=e=>T.isFunction(e)||e===null||e===!1;function Sb(e,t){e=T.isArray(e)?e:[e];const{length:r}=e;let n,s;const i={};for(let o=0;o<r;o++){n=e[o];let a;if(s=n,!wb(n)&&(s=la[(a=String(n)).toLowerCase()],s===void 0))throw new Q(`Unknown adapter '${a}'`);if(s&&(T.isFunction(s)||(s=s.get(t))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since :
|
|
451
|
+
`+o.map(Au).join(`
|
|
452
|
+
`):" "+Au(o[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const Pu={getAdapter:Sb,adapters:la};function ca(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gs(null,e)}function Mu(e){return ca(e),e.headers=nt.from(e.headers),e.data=oa.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pu.getAdapter(e.adapter||ps.adapter,e)(e).then(function(n){ca(e),e.response=n;try{n.data=oa.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=nt.from(n.headers),n},function(n){if(!bu(n)&&(ca(e),n&&n.response)){e.response=n.response;try{n.response.data=oa.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=nt.from(n.response.headers)}return Promise.reject(n)})}const wi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Lu={};wi.transitional=function(t,r,n){function s(i,o){return"[Axios v"+aa+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,a)=>{if(t===!1)throw new Q(s(o," has been removed"+(r?" in "+r:"")),Q.ERR_DEPRECATED);return r&&!Lu[o]&&(Lu[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,a):!0}},wi.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Cb(e,t,r){if(typeof e!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const i=n[s],o=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new Q("option "+i+" must be "+c,Q.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}}const Si={assertOptions:Cb,validators:wi},st=Si.validators;let zr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new gu,response:new gu}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=(()=>{if(!s.stack)return"";const o=s.stack.indexOf(`
|
|
453
|
+
`);return o===-1?"":s.stack.slice(o+1)})();try{if(!n.stack)n.stack=i;else if(i){const o=i.indexOf(`
|
|
454
|
+
`),a=o===-1?-1:i.indexOf(`
|
|
455
|
+
`,o+1),c=a===-1?"":i.slice(a+1);String(n.stack).endsWith(c)||(n.stack+=`
|
|
456
|
+
`+i)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ur(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&Si.assertOptions(n,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean),legacyInterceptorReqResOrdering:st.transitional(st.boolean),advertiseZstdAcceptEncoding:st.transitional(st.boolean),validateStatusUndefinedResolves:st.transitional(st.boolean)},!1),s!=null&&(T.isFunction(s)?r.paramsSerializer={serialize:s}:Si.assertOptions(s,{encode:st.function,serialize:st.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Si.assertOptions(r,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&T.merge(i.common,i[r.method]);i&&T.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete i[b]}),r.headers=nt.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;c=c&&h.synchronous;const v=r.transitional||na;v&&v.legacyInterceptorReqResOrdering?a.unshift(h.fulfilled,h.rejected):a.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,y;if(!c){const b=[Mu.bind(this),void 0];for(b.unshift(...a),b.push(...u),y=b.length,d=Promise.resolve(r);f<y;)d=d.then(b[f++],b[f++]);return d}y=a.length;let g=r;for(;f<y;){const b=a[f++],h=a[f++];try{g=b(g)}catch(v){h.call(this,v);break}}try{d=Mu.call(this,g)}catch(b){return Promise.reject(b)}for(f=0,y=u.length;f<y;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=Ur(this.defaults,t);const r=Eu(t.baseURL,t.url,t.allowAbsoluteUrls,t);return pu(r,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){zr.prototype[t]=function(r,n){return this.request(Ur(n||{},{method:t,url:r,data:n&&T.hasOwnProp(n,"data")?n.data:void 0}))}}),T.forEach(["post","put","patch","query"],function(t){function r(n){return function(i,o,a){return this.request(Ur(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}zr.prototype[t]=r(),t!=="query"&&(zr.prototype[t+"Form"]=r(!0))});let Eb=class Qh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,a){n.reason||(n.reason=new gs(i,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Qh(function(s){t=s}),cancel:t}}};function Ob(e){return function(r){return e.apply(null,r)}}function Db(e){return T.isObject(e)&&e.isAxiosError===!0}const ua={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ua).forEach(([e,t])=>{ua[t]=e});function Fu(e){const t=new zr(e),r=Xc(zr.prototype.request,t);return T.extend(r,zr.prototype,t,{allOwnKeys:!0}),T.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Fu(Ur(e,s))},r}const Ve=Fu(ps);Ve.Axios=zr,Ve.CanceledError=gs,Ve.CancelToken=Eb,Ve.isCancel=bu,Ve.VERSION=aa,Ve.toFormData=vi,Ve.AxiosError=Q,Ve.Cancel=Ve.CanceledError,Ve.all=function(t){return Promise.all(t)},Ve.spread=Ob,Ve.isAxiosError=Db,Ve.mergeConfig=Ur,Ve.AxiosHeaders=nt,Ve.formToJSON=e=>mu(T.isHTMLForm(e)?new FormData(e):e),Ve.getAdapter=Pu.getAdapter,Ve.HttpStatusCode=ua,Ve.default=Ve;const{Axios:PO,AxiosError:MO,CanceledError:LO,isCancel:FO,CancelToken:$O,VERSION:BO,all:jO,Cancel:VO,isAxiosError:UO,spread:zO,toFormData:HO,AxiosHeaders:qO,HttpStatusCode:WO,formToJSON:KO,getAdapter:GO,mergeConfig:QO,create:YO}=Ve;let da="";function $u(e){da=e}const Ue=Ve.create({timeout:3e4});Ue.interceptors.request.use(async e=>{var s,i;const{useEditorStore:t}=await Promise.resolve().then(()=>Gc),n=(i=(s=t.getState().editorConfig)==null?void 0:s.context)==null?void 0:i.authToken;return n&&(e.headers=e.headers??{},e.headers.Authorization=`Bearer ${n}`),da&&(e.baseURL=da),e});function Bu(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=(r.mimeType??"")==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent",a=r.children,c=Array.isArray(a)?a.map(u=>Bu(u,n)):[];return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:o,children:c,metadata:r,parent:t}}async function Tb(e){var s,i,o,a,c,u,d;const t=await Ue.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(i=(s=t.data)==null?void 0:s.result)==null?void 0:i.content;if(!r||!r.identifier){const f=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=Bu(r);return{content:r,rootNode:n}}async function Ib(e,t,r,n){await Ue.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})}async function Nb(e){await Ue.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:""}}})}async function xb(e){var r,n;return(n=(r=(await Ue.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function kb(e,t){await Ue.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const me={overlay:"_overlay_109ur_1",modal:"_modal_109ur_11",modalHeader:"_modalHeader_109ur_23",modalHeaderClose:"_modalHeaderClose_109ur_33",modalBody:"_modalBody_109ur_51",modalFooter:"_modalFooter_109ur_58",checkRow:"_checkRow_109ur_65",checkIcon:"_checkIcon_109ur_74",pass:"_pass_109ur_84",fail:"_fail_109ur_88",divider:"_divider_109ur_92",errorBanner:"_errorBanner_109ur_98",formGroup:"_formGroup_109ur_108",textarea:"_textarea_109ur_119",sliderGroup:"_sliderGroup_109ur_140",sliderValue:"_sliderValue_109ur_152",sliderLabels:"_sliderLabels_109ur_160",sectionTitle:"_sectionTitle_109ur_168"};function Ab(){return l.jsx("span",{className:`${me.checkIcon} ${me.pass}`,"aria-label":"passed",children:"✓"})}function Pb(){return l.jsx("span",{className:`${me.checkIcon} ${me.fail}`,"aria-label":"failed",children:"✗"})}const Mb=({contentId:e,onConfirm:t,onCancel:r})=>{const[n,s]=p.useState(!1),i=Ie(b=>b.treeData),o=Ee(b=>b.publishChecklist)??[],[a,c]=p.useState({}),u=o.every(b=>a[b.code]),d=p.useMemo(()=>{var x,A,B,P,F,q;const b=i[0],h=!!(b!=null&&b.name&&b.name.trim().length>0),v=!!((x=b==null?void 0:b.description)!=null&&x.trim()||(B=(A=b==null?void 0:b.metadata)==null?void 0:A.description)!=null&&B.trim()),m=!!(b!=null&&b.appIcon||(P=b==null?void 0:b.metadata)!=null&&P.appIcon),_=(b==null?void 0:b.children)??[],S=_.some(k=>k.isFolder);function w(k){for(const L of k)if(!L.isFolder||L.children&&w(L.children))return!0;return!1}const C=w(_),D=!!((q=(F=b==null?void 0:b.metadata)==null?void 0:F.license)!=null&&q.trim());return[{label:"Root node has a title and description",passed:h&&v,critical:!0},{label:"Root node has an app icon",passed:m,critical:!0},{label:"At least one unit exists",passed:S,critical:!0},{label:"At least one content item added",passed:C,critical:!0},{label:"License field is set",passed:D,critical:!0}]},[i]),f=d.every(b=>!b.critical||b.passed)&&u,y=d.filter(b=>!b.passed).length,g=async()=>{s(!0);try{await Nb(e),je.success("Content published successfully"),t()}catch(b){const h=b instanceof Error?b.message:"Failed to publish content";je.error(h)}finally{s(!1)}};return l.jsx("div",{className:me.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:me.modal,children:[l.jsxs("div",{className:me.modalHeader,children:[l.jsx("span",{id:"publish-modal-title",children:"Publish Checklist"}),l.jsx("button",{className:me.modalHeaderClose,onClick:r,"aria-label":"Close",disabled:n,children:"×"})]}),l.jsxs("div",{className:me.modalBody,children:[l.jsx("p",{className:me.sectionTitle,children:"Pre-publish validation"}),d.map(b=>l.jsxs("div",{className:me.checkRow,children:[b.passed?l.jsx(Ab,{}):l.jsx(Pb,{}),l.jsx("span",{children:b.label})]},b.label)),o.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("hr",{className:me.divider}),l.jsx("p",{className:me.sectionTitle,children:"Reviewer confirmation"}),o.map(b=>l.jsxs("label",{className:me.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!a[b.code],disabled:n,onChange:h=>c(v=>({...v,[b.code]:h.target.checked}))}),l.jsx("span",{children:b.label})]},b.code))]}),y>0&&l.jsxs(l.Fragment,{children:[l.jsx("hr",{className:me.divider}),l.jsx("div",{className:me.errorBanner,children:y===1?"1 check failed. Please resolve it before publishing.":`${y} checks failed. Please resolve them before publishing.`})]})]}),l.jsxs("div",{className:me.modalFooter,children:[l.jsx(Ne,{variant:"ghost",onClick:r,disabled:n,children:"Cancel"}),l.jsx(Ne,{variant:"primary",onClick:g,disabled:!f||n,isLoading:n,children:n?"Publishing…":"Publish"})]})]})})},Lb=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const[s,i]=p.useState(""),[o,a]=p.useState(7),c=t==="approve",u=c?"Review Quality":"Reject Content",d=!c&&s.trim().length===0,f=()=>{c?r(s.trim(),o):r(s.trim())};return l.jsx("div",{className:me.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:me.modal,children:[l.jsxs("div",{className:me.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:me.modalHeaderClose,onClick:n,"aria-label":"Close",children:"×"})]}),l.jsx("div",{className:me.modalBody,children:c?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:me.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:"Quality Score"}),l.jsxs("div",{className:me.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:o,onChange:y=>a(Number(y.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":o}),l.jsx("span",{className:me.sliderValue,children:o})]}),l.jsxs("div",{className:me.sliderLabels,children:[l.jsx("span",{children:"0 — Poor"}),l.jsx("span",{children:"10 — Excellent"})]})]}),l.jsxs("div",{className:me.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:["Comment"," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:"(optional)"})]}),l.jsx("textarea",{id:"quality-comment",className:me.textarea,placeholder:"Add any notes for the content creator…",value:s,onChange:y=>i(y.target.value),rows:4})]})]}):l.jsxs("div",{className:me.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:["Rejection Reason"," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:me.textarea,placeholder:"Describe why this content is being rejected…",value:s,onChange:y=>i(y.target.value),rows:5,required:!0,"aria-required":"true"}),s.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:"A rejection reason is required."})]})}),l.jsxs("div",{className:me.modalFooter,children:[l.jsx(Ne,{variant:"ghost",onClick:n,children:"Cancel"}),l.jsx(Ne,{variant:c?"primary":"danger",onClick:f,disabled:d,children:c?"Approve":"Reject"})]})]})})},ju=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function Fb(e,t={}){var s,i,o;const r={"organisations.roles":"CONTENT_CREATOR"};return t.rootOrgId&&(r.rootOrgId=t.rootOrgId),((o=(i=(s=(await Ue.post("/api/user/v1/search",{request:{query:e,filters:r,fields:ju,offset:0,limit:t.limit??20}})).data)==null?void 0:s.result)==null?void 0:i.response)==null?void 0:o.content)??[]}async function $b(e){var r,n,s;return e.length?((s=(n=(r=(await Ue.post("/api/user/v1/search",{request:{filters:{userId:e},fields:ju,limit:e.length}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:s.content)??[]:[]}const Se={container:"_container_1cpb1_1",header:"_header_1cpb1_13",title:"_title_1cpb1_22",closeBtn:"_closeBtn_1cpb1_29",body:"_body_1cpb1_45",label:"_label_1cpb1_54",searchSection:"_searchSection_1cpb1_62",searchRow:"_searchRow_1cpb1_68",searchInput:"_searchInput_1cpb1_74",searchSpinner:"_searchSpinner_1cpb1_89",resultsList:"_resultsList_1cpb1_105",resultItem:"_resultItem_1cpb1_118",userInfo:"_userInfo_1cpb1_133",userName:"_userName_1cpb1_141",userEmail:"_userEmail_1cpb1_150",noResults:"_noResults_1cpb1_158",collabSection:"_collabSection_1cpb1_165",sectionTitle:"_sectionTitle_1cpb1_170",badge:"_badge_1cpb1_180",emptyCollab:"_emptyCollab_1cpb1_194",collabList:"_collabList_1cpb1_205",collabItem:"_collabItem_1cpb1_214",userAvatar:"_userAvatar_1cpb1_228",error:"_error_1cpb1_242",success:"_success_1cpb1_248",footer:"_footer_1cpb1_254"},Bb=({contentId:e,onClose:t})=>{const[r,n]=p.useState(""),[s,i]=p.useState([]),[o,a]=p.useState(!1),[c,u]=p.useState([]),[d,f]=p.useState(!1),[y,g]=p.useState(""),[b,h]=p.useState(!1),v=p.useRef(null);p.useEffect(()=>{let C=!1;return(async()=>{try{const D=await xb(e),x=(D==null?void 0:D.collaborators)??[];if(!x.length)return;const A=await $b(x);if(C)return;const B=x.map(P=>A.find(F=>F.identifier===P)??{identifier:P,firstName:P});u(B)}catch{}})(),()=>{C=!0}},[e]),p.useEffect(()=>{v.current&&clearTimeout(v.current);const C=r.trim();if(C.length<2){i([]);return}return v.current=setTimeout(async()=>{a(!0);try{const D=await Fb(C),x=new Set(c.map(A=>A.identifier));i(D.filter(A=>!x.has(A.identifier)))}catch{i([])}finally{a(!1)}},300),()=>{v.current&&clearTimeout(v.current)}},[r,c]);const m=p.useCallback(C=>{u(D=>D.find(x=>x.identifier===C.identifier)?D:[...D,C]),i(D=>D.filter(x=>x.identifier!==C.identifier)),h(!1)},[]),_=p.useCallback(C=>{u(D=>D.filter(x=>x.identifier!==C)),h(!1)},[]),S=p.useCallback(async()=>{f(!0),g(""),h(!1);try{await kb(e,c.map(C=>C.identifier)),h(!0)}catch{g("Failed to save collaborators. Please try again.")}finally{f(!1)}},[e,c]),w=C=>`${C.firstName}${C.lastName?` ${C.lastName}`:""}`;return l.jsxs("div",{className:Se.container,children:[l.jsxs("div",{className:Se.header,children:[l.jsx("h2",{className:Se.title,children:"Manage Collaborators"}),l.jsx("button",{className:Se.closeBtn,onClick:t,"aria-label":"Close",children:"✕"})]}),l.jsxs("div",{className:Se.body,children:[l.jsxs("div",{className:Se.searchSection,children:[l.jsx("label",{className:Se.label,htmlFor:"collab-search",children:"Search users"}),l.jsxs("div",{className:Se.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Se.searchInput,placeholder:"Search by name or email...",value:r,onChange:C=>n(C.target.value)}),o&&l.jsx("span",{className:Se.searchSpinner,"aria-label":"Searching..."})]}),s.length>0&&l.jsx("ul",{className:Se.resultsList,role:"listbox","aria-label":"Search results",children:s.map(C=>l.jsxs("li",{className:Se.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Se.userInfo,children:[l.jsx("span",{className:Se.userName,children:w(C)}),C.email&&l.jsx("span",{className:Se.userEmail,children:C.email})]}),l.jsx(Ne,{variant:"primary",size:"sm",onClick:()=>m(C),children:"Add"})]},C.identifier))}),r.trim().length>=2&&!o&&s.length===0&&l.jsx("p",{className:Se.noResults,children:"No users found."})]}),l.jsxs("div",{className:Se.collabSection,children:[l.jsxs("h3",{className:Se.sectionTitle,children:["Current Collaborators",c.length>0&&l.jsx("span",{className:Se.badge,children:c.length})]}),c.length===0?l.jsx("p",{className:Se.emptyCollab,children:"No collaborators added yet."}):l.jsx("ul",{className:Se.collabList,children:c.map(C=>l.jsxs("li",{className:Se.collabItem,children:[l.jsx("div",{className:Se.userAvatar,"aria-hidden":"true",children:w(C).charAt(0).toUpperCase()}),l.jsxs("div",{className:Se.userInfo,children:[l.jsx("span",{className:Se.userName,children:w(C)}),C.email&&l.jsx("span",{className:Se.userEmail,children:C.email})]}),l.jsx(Ne,{variant:"danger",size:"sm",onClick:()=>_(C.identifier),children:"Remove"})]},C.identifier))})]}),y&&l.jsx("p",{className:Se.error,role:"alert",children:y}),b&&l.jsx("p",{className:Se.success,role:"status",children:"Collaborators saved successfully."})]}),l.jsxs("div",{className:Se.footer,children:[l.jsx(Ne,{variant:"ghost",onClick:t,disabled:d,children:"Cancel"}),l.jsx(Ne,{variant:"primary",isLoading:d,onClick:S,children:"Save"})]})]})};async function jb(e){return(await Ue.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function Vb(e,t){var n,s;return((s=(n=(await Ue.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:n.result)==null?void 0:s.processId)??""}async function Ub(e){var r;return((r=(await Ue.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}const de={topbar:"_topbar_1k1pv_1",left:"_left_1k1pv_15",right:"_right_1k1pv_23",backBtn:"_backBtn_1k1pv_30",title:"_title_1k1pv_49",statusChip:"_statusChip_1k1pv_61",savedIndicator:"_savedIndicator_1k1pv_73",unsaved:"_unsaved_1k1pv_83",iconBtn:"_iconBtn_1k1pv_87",iconBtnLabel:"_iconBtnLabel_1k1pv_114",qrDropdown:"_qrDropdown_1k1pv_118",qrMenu:"_qrMenu_1k1pv_122",reviewBtns:"_reviewBtns_1k1pv_157",sourcingBtns:"_sourcingBtns_1k1pv_166",modalOverlay:"_modalOverlay_1k1pv_175",sbOverlay:"_sbOverlay_1k1pv_185",sbModal:"_sbModal_1k1pv_195",sbModalHeader:"_sbModalHeader_1k1pv_206",sbModalTitle:"_sbModalTitle_1k1pv_214",sbModalClose:"_sbModalClose_1k1pv_221",sbModalBody:"_sbModalBody_1k1pv_234",sbLabel:"_sbLabel_1k1pv_241",sbTextarea:"_sbTextarea_1k1pv_248",sbError:"_sbError_1k1pv_265",sbModalFooter:"_sbModalFooter_1k1pv_272"};function zb(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function Hb(e){return typeof e=="string"&&e.trim().length>0?e.trim():"Draft"}const qb=({onConfirm:e,onCancel:t})=>{const[r,n]=p.useState("");return l.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"sendback-title",children:l.jsxs("div",{className:de.sbModal,children:[l.jsxs("div",{className:de.sbModalHeader,children:[l.jsx("span",{id:"sendback-title",className:de.sbModalTitle,children:"Send Back for Corrections"}),l.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":"Close",type:"button",children:"×"})]}),l.jsxs("div",{className:de.sbModalBody,children:[l.jsxs("label",{className:de.sbLabel,htmlFor:"sendback-comment",children:["Comment ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"sendback-comment",className:de.sbTextarea,placeholder:"Describe what needs to be corrected…",value:r,onChange:s=>n(s.target.value),rows:4,required:!0,"aria-required":"true"}),r.trim().length===0&&l.jsx("p",{className:de.sbError,children:"A comment is required."})]}),l.jsxs("div",{className:de.sbModalFooter,children:[l.jsx(Ne,{variant:"ghost",onClick:t,children:"Cancel"}),l.jsx(Ne,{variant:"primary",onClick:()=>e(r.trim()),disabled:r.trim().length===0,children:"Send Back"})]})]})})},Wb=({onConfirm:e,onCancel:t})=>{const[r,n]=p.useState(""),s=parseInt(r,10),i=!isNaN(s)&&s>=1&&s<=250;return l.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:de.sbModal,children:[l.jsxs("div",{className:de.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:de.sbModalTitle,children:"Generate QR Codes"}),l.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":"Close",type:"button",children:"×"})]}),l.jsxs("div",{className:de.sbModalBody,children:[l.jsxs("label",{className:de.sbLabel,htmlFor:"qr-count",children:["Number of QR Codes ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:1,max:250,className:de.sbTextarea,style:{resize:"none",height:"40px"},placeholder:"Enter number (1–250)",value:r,onChange:o=>n(o.target.value)}),r&&!i&&l.jsx("p",{className:de.sbError,children:"Enter a number between 1 and 250."})]}),l.jsxs("div",{className:de.sbModalFooter,children:[l.jsx(Ne,{variant:"ghost",onClick:t,children:"Cancel"}),l.jsx(Ne,{variant:"primary",onClick:()=>e(s),disabled:!i,children:"Generate"})]})]})})},Kb=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,onToolbarEvent:s})=>{var W,J;const o=Ie(Y=>Y.treeData)[0],a=(o==null?void 0:o.name)??"Untitled",c=Hb(((W=o==null?void 0:o.metadata)==null?void 0:W.status)??(o==null?void 0:o.status)),u=Ee(Y=>{var se,ue,X,we;return((ue=(se=Y.editorConfig)==null?void 0:se.context)==null?void 0:ue.contentId)??((we=(X=Y.editorConfig)==null?void 0:X.context)==null?void 0:we.identifier)??""}),{activeModal:d,modalData:f,closeModal:y,openModal:g}=Av(),[b,h]=p.useState(!1),[v,m]=p.useState(!1),_=p.useRef(null),[S,w]=p.useState(!1);p.useEffect(()=>{if(!v)return;const Y=se=>{var ue;(ue=_.current)!=null&&ue.contains(se.target)||m(!1)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[v]);const[C,D]=p.useState(!1),[x,A]=p.useState(!1),{updateNode:B}=Ie(),P=(J=o==null?void 0:o.metadata)==null?void 0:J.qrCodeProcessId,F=p.useCallback(async Y=>{if(u){w(!1),D(!0);try{const se=await Vb(u,Y);se&&o&&B(o.id,{qrCodeProcessId:se}),ht.success('QR Codes generation started. Use "Download QR Codes" once ready.')}catch{ht.error("Failed to generate QR Codes. Please try again.")}finally{D(!1)}}},[u,o,B]),q=p.useCallback(async()=>{if(!P){ht.error("No QR codes generated yet. Generate QR Codes first.");return}A(!0);try{const se=(await Ub(P)).zipFileName;if(se){const ue=document.createElement("a");ue.href=se,ue.download="qrcodes.zip",ue.target="_blank",document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)}else ht.error("QR Codes not ready yet. Please wait and try again.")}catch{ht.error("Failed to download QR Codes.")}finally{A(!1)}},[P]),k=e==="edit",L=e==="review",$=e==="sourcingreview",ee=e==="read",R=p.useCallback((Y,se)=>{s({action:Y,data:se})},[s]),H=p.useCallback(()=>{y(),R("publish")},[y,R]),te=p.useCallback((Y,se)=>{const ue=f==null?void 0:f.action;y(),ue==="approve"?R("sourcingApprove",{comment:Y,score:se}):R("reject",{comment:Y})},[y,R,f]),ae=p.useCallback(Y=>{h(!1),R("sendBackForCorrections",{comment:Y})},[R]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:de.topbar,role:"banner",children:[l.jsxs("div",{className:de.left,children:[l.jsx("button",{className:de.backBtn,onClick:()=>R("back"),"aria-label":"Go back",type:"button",children:l.jsx(Zy,{size:18})}),l.jsx("h1",{className:de.title,title:a,children:a}),l.jsx("span",{className:`sbx-chip ${de.statusChip}`,"aria-label":`Status: ${c}`,children:c})]}),l.jsxs("div",{className:de.right,children:[t?l.jsx("span",{className:de.savedIndicator,"aria-live":"polite",children:"Saving…"}):n?l.jsxs("span",{className:de.savedIndicator,"aria-live":"polite",children:[l.jsx(fn,{size:14,"aria-hidden":"true"}),"Saved ",zb(n)]}):r?l.jsx("span",{className:`${de.savedIndicator} ${de.unsaved}`,"aria-live":"polite",children:"Unsaved changes"}):null,!ee&&l.jsx(Ne,{variant:"ghost",size:"sm",onClick:()=>R("saveCollection"),children:"Save as Draft"}),k&&l.jsxs(l.Fragment,{children:[l.jsxs(Ne,{variant:"primary",size:"sm",onClick:()=>R("sendForReview"),children:[l.jsx(pv,{size:14,"aria-hidden":"true"})," Send for review"]}),l.jsx("button",{className:de.iconBtn,onClick:()=>g("manageCollaborators"),"aria-label":"Collaborators",title:"Collaborators",type:"button",children:l.jsx(vv,{size:16,"aria-hidden":"true"})}),l.jsxs("div",{className:de.qrDropdown,ref:_,children:[l.jsxs("button",{className:de.iconBtn,onClick:()=>m(Y=>!Y),"aria-label":"QR Codes",title:"QR Codes",type:"button","aria-haspopup":"true","aria-expanded":v,children:[l.jsx(Lc,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:de.iconBtnLabel,children:"QR Codes"}),l.jsx("span",{style:{fontSize:10,marginLeft:2},children:"▾"})]}),v&&l.jsxs("div",{className:de.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{m(!1),w(!0)},disabled:C,children:[l.jsx(Lc,{size:14}),C?"Generating…":"Generate QR Codes"]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{m(!1),q()},disabled:x||!P,children:[l.jsx(rv,{size:14}),x?"Downloading…":"Download QR Codes"]})]})]})]}),L&&l.jsxs("div",{className:de.reviewBtns,children:[l.jsxs(Ne,{variant:"primary",size:"sm",onClick:()=>g("publishChecklist"),children:[l.jsx(xc,{size:14,"aria-hidden":"true"})," Publish"]}),l.jsxs(Ne,{variant:"danger",size:"sm",onClick:()=>g("qualityParams",{action:"reject"}),children:[l.jsx(Lo,{size:14,"aria-hidden":"true"})," Reject"]}),l.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>h(!0),children:[l.jsx(fv,{size:14,"aria-hidden":"true"})," Send Back"]})]}),$&&l.jsxs("div",{className:de.sourcingBtns,children:[l.jsxs(Ne,{variant:"primary",size:"sm",onClick:()=>g("qualityParams",{action:"approve"}),children:[l.jsx(gv,{size:14,"aria-hidden":"true"})," Approve"]}),l.jsxs(Ne,{variant:"danger",size:"sm",onClick:()=>g("qualityParams",{action:"reject"}),children:[l.jsx(Lo,{size:14,"aria-hidden":"true"})," Reject"]})]})]})]}),d==="publishChecklist"&&l.jsx(Mb,{contentId:u,onConfirm:H,onCancel:y}),d==="qualityParams"&&l.jsx(Lb,{contentId:u,action:(f==null?void 0:f.action)??"reject",onConfirm:te,onCancel:y}),d==="manageCollaborators"&&l.jsx("div",{className:de.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(Bb,{contentId:u,onClose:y})}),b&&l.jsx(qb,{onConfirm:ae,onCancel:()=>h(!1)}),S&&l.jsx(Wb,{onConfirm:F,onCancel:()=>w(!1)})]})};var Gb=Go();const Vu=p.createContext(null);function bt(){const e=p.useContext(Vu);if(e===null)throw new Error("No Tree Api Provided");return e}const Uu=p.createContext(null);function Qb(){const e=p.useContext(Uu);if(e===null)throw new Error("Provide a NodesContext");return e}const zu=p.createContext(null);function Yb(){const e=p.useContext(zu);if(e===null)throw new Error("Provide a DnDContext");return e}const Hu=p.createContext(0);function qu(){p.useContext(Hu)}function Ci(e,t,r){return Math.max(Math.min(e,r),t)}function Wu(e){return e&&e.isLeaf}function Ku(e){return e&&e.isInternal&&!e.isOpen}function Gu(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Qu=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Yu=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function fa(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=fa(r,t);if(n)return n}return null}function Ei(e,t){if(t(e),e.children)for(let r of e.children)Ei(r,t)}function Ru(e){const t=Zu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Rb(t,n);break}r==null||r.focus()}function Xu(e){const t=Zu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Xb(t,n);break}r==null||r.focus()}function Rb(e,t){return t+1<e.length?e[t+1]:e[0]}function Xb(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Zu(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function ys(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function _n(e){return typeof e=="string"?e:e.id}function Zb(e,...t){if(e)return e(...t)}function Ju(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function ed(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function td(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Jb=Object.freeze(Object.defineProperty({__proto__:null,access:ys,bound:Ci,dfs:fa,focusNextElement:Ru,focusPrevElement:Xu,getInsertIndex:ed,getInsertParentId:td,identify:_n,indexOf:Yu,isClosed:Ku,isDescendant:Qu,isItem:Wu,isOpenWithEmptyChildren:Gu,safeRun:Zb,waitFor:Ju,walk:Ei},Symbol.toStringTag,{value:"Module"})),e_={display:"flex",alignItems:"center",zIndex:1},t_={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},r_={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},n_=p.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},e_),s),children:[l.jsx("div",{style:Object.assign({},r_)}),l.jsx("div",{style:Object.assign({},t_)})]})});function s_({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function i_(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(a_,Object.assign({},e)):l.jsx(o_,Object.assign({},e))]})}function o_(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function a_({node:e}){const t=p.useRef();return p.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const vs="__REACT_ARBORIST_INTERNAL_ROOT__";function rd(e){var t;function r(i,o,a){const c=e.accessId(i),u=new ms({tree:e,data:i,level:o,parent:a,id:c,children:null,isDraggable:e.isDraggable(i),rowIndex:null}),d=e.accessChildren(i);return d&&(u.children=d.map(f=>r(f,o+1,u))),u}const n=new ms({tree:e,id:vs,data:{id:vs},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(i=>r(i,0,n)),n}class ms{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===vs}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new ms(Object.assign({},this))}edit(){return this.tree.edit(this)}}function ha(e){return{type:"EDIT",id:e}}function l_(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function wn(e){return{type:"FOCUS",id:e}}function c_(){return{type:"TREE_BLUR"}}function u_(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const pa={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function nd(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function d_(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:nd(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:nd(e.unfiltered,t)}):e}const Sn=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Cr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:_n(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(_n)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(_n)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:_n(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:_n(e)})};function f_(e=Sn().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const Cn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function h_(e=Sn().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return Sn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const p_={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},g_=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},y_=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function sd({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(v_,{isDragging:s,children:[l.jsx(m_,{offset:e,children:l.jsx(__,{id:r,dragIds:n})}),l.jsx(b_,{mouse:t,count:n.length})]})}const v_=p.memo(function(t){return t.isDragging?l.jsx("div",{style:p_,children:t.children}):null});function m_(e){return l.jsx("div",{className:"row preview",style:g_(e.offset),children:e.children})}function b_(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:y_(r),children:t}):null}const __=p.memo(function(t){const r=bt(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ga.apply(null,arguments)}function id(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ya(e,t){return ya=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ya(e,t)}function w_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ya(e,t)}var od=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function S_(e,t){return!!(e===t||od(e)&&od(t))}function C_(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!S_(e[r],t[r]))return!1;return!0}function va(e,t){t===void 0&&(t=C_);var r,n=[],s,i=!1;function o(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return i&&r===this&&t(a,n)||(s=e.apply(this,a),i=!0,r=this,n=a),s}return o}var E_=typeof performance=="object"&&typeof performance.now=="function",ad=E_?function(){return performance.now()}:function(){return Date.now()};function ld(e){cancelAnimationFrame(e.id)}function O_(e,t){var r=ad();function n(){ad()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var ma=-1;function cd(e){if(e===void 0&&(e=!1),ma===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),ma=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ma}var En=null;function ud(e){if(e===void 0&&(e=!1),En===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?En="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?En="negative":En="positive-ascending"),document.body.removeChild(t),En}return En}process.env.NODE_ENV;var D_=150,T_=function(t,r){return t},Oi=null,Di=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Oi=new WeakSet,Di=new WeakSet);function dd(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,i=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(f){w_(y,f);function y(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,id(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:id(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=va(function(v,m,_,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:m,visibleStartIndex:_,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=va(function(v,m,_){return h.props.onScroll({scrollDirection:v,scrollOffset:m,scrollUpdateWasRequested:_})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var m=h.props,_=m.direction,S=m.itemSize,w=m.layout,C=h._getItemStyleCache(u&&S,u&&w,u&&_),D;if(C.hasOwnProperty(v))D=C[v];else{var x=r(h.props,v,h._instanceProps),A=s(h.props,v,h._instanceProps),B=_==="horizontal"||w==="horizontal",P=_==="rtl",F=B?x:0;C[v]=D={position:"absolute",left:P?void 0:F,right:P?F:void 0,top:B?0:x,height:B?"100%":A,width:B?A:"100%"}}return D},h._getItemStyleCache=void 0,h._getItemStyleCache=va(function(v,m,_){return{}}),h._onScrollHorizontal=function(v){var m=v.currentTarget,_=m.clientWidth,S=m.scrollLeft,w=m.scrollWidth;h.setState(function(C){if(C.scrollOffset===S)return null;var D=h.props.direction,x=S;if(D==="rtl")switch(ud()){case"negative":x=-S;break;case"positive-descending":x=w-_-S;break}return x=Math.max(0,Math.min(x,w-_)),{isScrolling:!0,scrollDirection:C.scrollOffset<x?"forward":"backward",scrollOffset:x,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var m=v.currentTarget,_=m.clientHeight,S=m.scrollHeight,w=m.scrollTop;h.setState(function(C){if(C.scrollOffset===w)return null;var D=Math.max(0,Math.min(w,S-_));return{isScrolling:!0,scrollDirection:C.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var m=h.props.outerRef;h._outerRef=v,typeof m=="function"?m(v):m!=null&&typeof m=="object"&&m.hasOwnProperty("current")&&(m.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&ld(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=O_(h._resetIsScrolling,D_)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}y.getDerivedStateFromProps=function(h,v){return I_(h,v),d(h),null};var g=y.prototype;return g.scrollTo=function(h){h=Math.max(0,h),this.setState(function(v){return v.scrollOffset===h?null:{scrollDirection:v.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(h,v){v===void 0&&(v="auto");var m=this.props,_=m.itemCount,S=m.layout,w=this.state.scrollOffset;h=Math.max(0,Math.min(h,_-1));var C=0;if(this._outerRef){var D=this._outerRef;S==="vertical"?C=D.scrollWidth>D.clientWidth?cd():0:C=D.scrollHeight>D.clientHeight?cd():0}this.scrollTo(i(this.props,h,v,w,this._instanceProps,C))},g.componentDidMount=function(){var h=this.props,v=h.direction,m=h.initialScrollOffset,_=h.layout;if(typeof m=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||_==="horizontal"?S.scrollLeft=m:S.scrollTop=m}this._callPropsCallbacks()},g.componentDidUpdate=function(){var h=this.props,v=h.direction,m=h.layout,_=this.state,S=_.scrollOffset,w=_.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var C=this._outerRef;if(v==="horizontal"||m==="horizontal")if(v==="rtl")switch(ud()){case"negative":C.scrollLeft=-S;break;case"positive-ascending":C.scrollLeft=S;break;default:var D=C.clientWidth,x=C.scrollWidth;C.scrollLeft=x-D-S;break}else C.scrollLeft=S;else C.scrollTop=S}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ld(this._resetIsScrollingTimeoutId)},g.render=function(){var h=this.props,v=h.children,m=h.className,_=h.direction,S=h.height,w=h.innerRef,C=h.innerElementType,D=h.innerTagName,x=h.itemCount,A=h.itemData,B=h.itemKey,P=B===void 0?T_:B,F=h.layout,q=h.outerElementType,k=h.outerTagName,L=h.style,$=h.useIsScrolling,ee=h.width,R=this.state.isScrolling,H=_==="horizontal"||F==="horizontal",te=H?this._onScrollHorizontal:this._onScrollVertical,ae=this._getRangeToRender(),W=ae[0],J=ae[1],Y=[];if(x>0)for(var se=W;se<=J;se++)Y.push(p.createElement(v,{data:A,key:P(se,A),index:se,isScrolling:$?R:void 0,style:this._getItemStyle(se)}));var ue=n(this.props,this._instanceProps);return p.createElement(q||k||"div",{className:m,onScroll:te,ref:this._outerRefSetter,style:ga({position:"relative",height:S,width:ee,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:_},L)},p.createElement(C||D||"div",{children:Y,ref:w,style:{height:H?"100%":ue,pointerEvents:R?"none":void 0,width:H?ue:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),m=v[0],_=v[1],S=v[2],w=v[3];this._callOnItemsRendered(m,_,S,w)}}if(typeof this.props.onScroll=="function"){var C=this.state,D=C.scrollDirection,x=C.scrollOffset,A=C.scrollUpdateWasRequested;this._callOnScroll(D,x,A)}},g._getRangeToRender=function(){var h=this.props,v=h.itemCount,m=h.overscanCount,_=this.state,S=_.isScrolling,w=_.scrollDirection,C=_.scrollOffset;if(v===0)return[0,0,0,0];var D=o(this.props,C,this._instanceProps),x=a(this.props,D,C,this._instanceProps),A=!S||w==="backward"?Math.max(1,m):1,B=!S||w==="forward"?Math.max(1,m):1;return[Math.max(0,D-A),Math.max(0,Math.min(v-1,x+B)),D,x]},y}(p.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var I_=function(t,r){var n=t.children,s=t.direction,i=t.height,o=t.layout,a=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Di&&!Di.has(d)&&(Di.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||o==="horizontal";switch(s){case"horizontal":case"vertical":Oi&&!Oi.has(d)&&(Oi.add(d),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},N_=50,On=function(t,r,n){var s=t,i=s.itemSize,o=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var c=0;if(a>=0){var u=o[a];c=u.offset+u.size}for(var d=a+1;d<=r;d++){var f=i(d);o[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return o[r]},x_=function(t,r,n){var s=r.itemMetadataMap,i=r.lastMeasuredIndex,o=i>0?s[i].offset:0;return o>=n?fd(t,r,i,0,n):k_(t,r,Math.max(0,i),n)},fd=function(t,r,n,s,i){for(;s<=n;){var o=s+Math.floor((n-s)/2),a=On(t,o,r).offset;if(a===i)return o;a<i?s=o+1:a>i&&(n=o-1)}return s>0?s-1:0},k_=function(t,r,n,s){for(var i=t.itemCount,o=1;n<i&&On(t,n,r).offset<s;)n+=o,o*=2;return fd(t,r,Math.min(n,i-1),Math.floor(n/2),s)},hd=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,i=r.estimatedItemSize,o=r.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var c=s[o];a=c.offset+c.size}var u=n-o-1,d=u*i;return a+d},A_=dd({getItemOffset:function(t,r,n){return On(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:hd,getOffsetForIndexAndAlignment:function(t,r,n,s,i,o){var a=t.direction,c=t.height,u=t.layout,d=t.width,f=a==="horizontal"||u==="horizontal",y=f?d:c,g=On(t,r,i),b=hd(t,i),h=Math.max(0,Math.min(b-y,g.offset)),v=Math.max(0,g.offset-y+g.size+o);switch(n==="smart"&&(s>=v-y&&s<=h+y?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return x_(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var i=t.direction,o=t.height,a=t.itemCount,c=t.layout,u=t.width,d=i==="horizontal"||c==="horizontal",f=d?u:o,y=On(t,r,s),g=n+f,b=y.offset+y.size,h=r;h<a-1&&b<g;)h++,b+=On(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:s||N_,lastMeasuredIndex:-1};return r.resetAfterIndex=function(o,a){a===void 0&&(a=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,o-1),r._getItemStyleCache(-1),a&&r.forceUpdate()},i},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),P_=dd({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,s,i,o){var a=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,y=t.width,g=a==="horizontal"||f==="horizontal",b=g?y:c,h=Math.max(0,u*d-b),v=Math.min(h,r*d),m=Math.max(0,r*d-b+d+o);switch(n==="smart"&&(s>=m-b&&s<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return m;case"center":{var _=Math.round(m+(v-m)/2);return _<Math.ceil(b/2)?0:_>h+Math.floor(b/2)?h:_}case"auto":default:return s>=m&&s<=v?s:s<m?m:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,i=t.height,o=t.itemCount,a=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*a,y=d?u:i,g=Math.ceil((y+n-f)/a);return Math.max(0,Math.min(o-1,r+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function M_(){var e,t;const r=bt(),s=Yb().cursor;if(!s||s.type!=="line")return null;const i=r.indent,o=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),a=i*s.level,c=r.renderCursor;return l.jsx(c,{top:o,left:a,indent:i})}var L_=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const F_=p.forwardRef(function(t,r){const{children:n}=t,s=L_(t,["children"]),i=bt();return l.jsxs("div",Object.assign({ref:r},s,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[l.jsx($_,{}),n]}))}),$_=()=>{const e=bt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(M_,{})})};var B_=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const j_=p.forwardRef(function(t,r){var n,s,i,o,{style:a}=t,c=B_(t,["style"]);const u=bt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(o=(i=u.props.padding)!==null&&i!==void 0?i:u.props.paddingBottom)!==null&&o!==void 0?o:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+f}px`})},c))});var pd=p.createContext({dragDropManager:void 0}),Lt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Lt||(Lt={}));function oe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var i;if(t===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;i=new Error(t.replace(/%s/g,function(){return n[o++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}var ba="dnd-core/INIT_COORDS",Ti="dnd-core/BEGIN_DRAG",_a="dnd-core/PUBLISH_DRAG_SOURCE",Ii="dnd-core/HOVER",Ni="dnd-core/DROP",xi="dnd-core/END_DRAG";function gd(e,t){return{type:ba,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function ki(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ki=function(r){return typeof r}:ki=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ki(e)}function V_(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function U_(e,t){return e.filter(function(r){return r!==t})}function yd(e){return ki(e)==="object"}function z_(e,t){var r=new Map,n=function(o){r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i,o){i===1&&s.push(o)}),s}function H_(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var q_={type:ba,payload:{clientOffset:null,sourceClientOffset:null}};function W_(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=n.publishSource,i=s===void 0?!0:s,o=n.clientOffset,a=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(gd(o)),K_(r,c,u);var d=Y_(r,c);if(d===null){e.dispatch(q_);return}var f=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");G_(a),f=a(d)}e.dispatch(gd(o,f));var y=u.getSource(d),g=y.beginDrag(c,d);if(g!=null){Q_(g),u.pinSource(d);var b=u.getSourceType(d);return{type:Ti,payload:{itemType:b,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}}}function K_(e,t,r){oe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){oe(r.getSource(n),"Expected sourceIds to be registered.")})}function G_(e){oe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Q_(e){oe(yd(e),"Item must be an object.")}function Y_(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function R_(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:_a}}}function wa(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function X_(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;Z_(r);var i=r.slice(0),o=e.getMonitor(),a=e.getRegistry();J_(i,o,a);var c=o.getItemType();return ew(i,a,c),tw(i,o,a),{type:Ii,payload:{targetIds:i,clientOffset:s||null}}}}function Z_(e){oe(Array.isArray(e),"Expected targetIds to be an array.")}function J_(e,t,r){oe(t.isDragging(),"Cannot call hover while not dragging."),oe(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];oe(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var i=r.getTarget(s);oe(i,"Expected targetIds to be registered.")}}function ew(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],i=t.getTargetType(s);wa(i,r)||e.splice(n,1)}}function tw(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function vd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function md(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vd(Object(r),!0).forEach(function(n){rw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nw(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();sw(n);var i=aw(n);i.forEach(function(o,a){var c=iw(o,a,s,n),u={type:Ni,payload:{dropResult:md(md({},r),c)}};e.dispatch(u)})}}function sw(e){oe(e.isDragging(),"Cannot call drop while not dragging."),oe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function iw(e,t,r,n){var s=r.getTarget(e),i=s?s.drop(n,e):void 0;return ow(i),typeof i>"u"&&(i=t===0?{}:n.getDropResult()),i}function ow(e){oe(typeof e>"u"||yd(e),"Drop result must either be an object or undefined.")}function aw(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function lw(e){return function(){var r=e.getMonitor(),n=e.getRegistry();cw(r);var s=r.getSourceId();if(s!=null){var i=n.getSource(s,!0);i.endDrag(r,s),n.unpinSource()}return{type:xi}}}function cw(e){oe(e.isDragging(),"Cannot call endDrag while not dragging.")}function uw(e){return{beginDrag:W_(e),publishDragSource:R_(e),hover:X_(e),drop:nw(e),endDrag:lw(e)}}function dw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hw(e,t,r){return t&&fw(e.prototype,t),e}function bs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var pw=function(){function e(t,r){var n=this;dw(this,e),bs(this,"store",void 0),bs(this,"monitor",void 0),bs(this,"backend",void 0),bs(this,"isSetUp",!1),bs(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return hw(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function s(o){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var d=o.apply(r,c);typeof d<"u"&&n(d)}}var i=uw(this);return Object.keys(i).reduce(function(o,a){var c=i[a];return o[a]=s(c),o},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e}();function Ft(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var bd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),_d=function(){return Math.random().toString(36).substring(7).split("").join(".")},wd={INIT:"@@redux/INIT"+_d(),REPLACE:"@@redux/REPLACE"+_d()};function gw(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function yw(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(bw(e))return"date";if(mw(e))return"error";var r=vw(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vw(e){return typeof e.constructor=="function"?e.constructor.name:null}function mw(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function bw(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Dn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=yw(e)),t}function Sd(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ft(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(1):"Expected the enhancer to be a function. Instead, received: '"+Dn(r)+"'");return r(Sd)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(2):"Expected the root reducer to be a function. Instead, received: '"+Dn(e)+"'");var s=e,i=t,o=[],a=o,c=!1;function u(){a===o&&(a=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(4):"Expected the listener to be a function. Instead, received: '"+Dn(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return u(),a.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,u();var _=a.indexOf(h);a.splice(_,1),o=null}}}function y(h){if(!gw(h))throw new Error(process.env.NODE_ENV==="production"?Ft(7):"Actions must be plain objects. Instead, the actual type was: '"+Dn(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ft(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(9):"Reducers may not dispatch actions.");try{c=!0,i=s(i,h)}finally{c=!1}for(var v=o=a,m=0;m<v.length;m++){var _=v[m];_()}return h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(10):"Expected the nextReducer to be a function. Instead, received: '"+Dn(h));s=h,y({type:wd.REPLACE})}function b(){var h,v=f;return h={subscribe:function(_){if(typeof _!="object"||_===null)throw new Error(process.env.NODE_ENV==="production"?Ft(11):"Expected the observer to be an object. Instead, received: '"+Dn(_)+"'");function S(){_.next&&_.next(d())}S();var w=v(S);return{unsubscribe:w}}},h[bd]=function(){return this},h}return y({type:wd.INIT}),n={dispatch:y,subscribe:f,getState:d,replaceReducer:g},n[bd]=b,n}var _w=function(t,r){return t===r};function ww(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Sw(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_w;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ed(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cd(Object(r),!0).forEach(function(n){Cw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Od={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ew(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Od,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ba:case Ti:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ii:return ww(e.clientOffset,r.clientOffset)?e:Ed(Ed({},e),{},{clientOffset:r.clientOffset});case xi:case Ni:return Od;default:return e}}var Sa="dnd-core/ADD_SOURCE",Ca="dnd-core/ADD_TARGET",Ea="dnd-core/REMOVE_SOURCE",Ai="dnd-core/REMOVE_TARGET";function Ow(e){return{type:Sa,payload:{sourceId:e}}}function Dw(e){return{type:Ca,payload:{targetId:e}}}function Tw(e){return{type:Ea,payload:{sourceId:e}}}function Iw(e){return{type:Ai,payload:{targetId:e}}}function Dd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dd(Object(r),!0).forEach(function(n){Nw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xw={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function kw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xw,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ti:return $t($t({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case _a:return $t($t({},e),{},{isSourcePublic:!0});case Ii:return $t($t({},e),{},{targetIds:r.targetIds});case Ai:return e.targetIds.indexOf(r.targetId)===-1?e:$t($t({},e),{},{targetIds:U_(e.targetIds,r.targetId)});case Ni:return $t($t({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case xi:return $t($t({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Aw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Sa:case Ca:return e+1;case Ea:case Ai:return e-1;default:return e}}var Pi=[],Oa=[];Pi.__IS_NONE__=!0,Oa.__IS_ALL__=!0;function Pw(e,t){if(e===Pi)return!1;if(e===Oa||typeof t>"u")return!0;var r=H_(t,e);return r.length>0}function Mw(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ii:break;case Sa:case Ca:case Ai:case Ea:return Pi;case Ti:case _a:case xi:case Ni:default:return Oa}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,i=s===void 0?[]:s,o=z_(n,i),a=o.length>0||!Sw(n,i);if(!a)return Pi;var c=i[i.length-1],u=n[n.length-1];return c!==u&&(c&&o.push(c),u&&o.push(u)),o}function Lw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Td(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Id(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Td(Object(r),!0).forEach(function(n){Fw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Td(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $w(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Mw(e.dirtyHandlerIds,{type:t.type,payload:Id(Id({},t.payload),{},{prevTargetIds:V_(e,"dragOperation.targetIds",[])})}),dragOffset:Ew(e.dragOffset,t),refCount:Aw(e.refCount,t),dragOperation:kw(e.dragOperation,t),stateId:Lw(e.stateId)}}function Bw(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Nd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jw(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Nd(Bw(t,n),r)}function Vw(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Nd(t,r)}function Uw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hw(e,t,r){return t&&zw(e.prototype,t),e}function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qw=function(){function e(t,r){Uw(this,e),xd(this,"store",void 0),xd(this,"registry",void 0),this.store=t,this.registry=r}return Hw(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},i=s.handlerIds;oe(typeof r=="function","listener must be a function."),oe(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===o||d===o+1&&!Pw(u.dirtyHandlerIds,i);f||r()}finally{o=d}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;oe(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,i=function(){var a=n.store.getState().dragOffset;a!==s&&(s=a,r())};return this.store.subscribe(i)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return oe(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(oe(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),i=this.getItemType();return wa(s,i)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(oe(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),i=this.getItemType();return s!==i?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var s=n.shallow;if(!this.isDragging())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();if(o&&!wa(i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var c=a.indexOf(r);return s?c===a.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return jw(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return Vw(this.store.getState().dragOffset)}}]),e}(),Ww=0;function Kw(){return Ww++}function Mi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mi=function(r){return typeof r}:Mi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mi(e)}function Gw(e){oe(typeof e.canDrag=="function","Expected canDrag to be a function."),oe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),oe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Qw(e){oe(typeof e.canDrop=="function","Expected canDrop to be a function."),oe(typeof e.hover=="function","Expected hover to be a function."),oe(typeof e.drop=="function","Expected beginDrag to be a function.")}function Da(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return Da(r,!1)});return}oe(typeof e=="string"||Mi(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const kd=typeof global<"u"?global:self,Ad=kd.MutationObserver||kd.WebKitMutationObserver;function Pd(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function Yw(e){let t=1;const r=new Ad(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Rw=typeof Ad=="function"?Yw:Pd;class Xw{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,s=t.length-this.index;n<s;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Rw(this.flush),this.requestErrorThrow=Pd(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Zw{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class Jw{create(t){const r=this.freeTasks,n=r.length?r.pop():new Zw(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Md=new Xw,eS=new Jw(Md.registerPendingError);function tS(e){Md.enqueueTask(eS.create(e))}function rS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sS(e,t,r){return t&&nS(e.prototype,t),e}function Tn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iS(e,t){return cS(e)||lS(e,t)||aS(e,t)||oS()}function oS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
457
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aS(e,t){if(e){if(typeof e=="string")return Ld(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ld(e,t)}}function Ld(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lS(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function cS(e){if(Array.isArray(e))return e}function uS(e){var t=Kw().toString();switch(e){case Lt.SOURCE:return"S".concat(t);case Lt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Fd(e){switch(e[0]){case"S":return Lt.SOURCE;case"T":return Lt.TARGET;default:oe(!1,"Cannot parse handler ID: ".concat(e))}}function $d(e,t){var r=e.entries(),n=!1;do{var s=r.next(),i=s.done,o=iS(s.value,2),a=o[1];if(a===t)return!0;n=!!i}while(!n);return!1}var dS=function(){function e(t){rS(this,e),Tn(this,"types",new Map),Tn(this,"dragSources",new Map),Tn(this,"dropTargets",new Map),Tn(this,"pinnedSourceId",null),Tn(this,"pinnedSource",null),Tn(this,"store",void 0),this.store=t}return sS(e,[{key:"addSource",value:function(r,n){Da(r),Gw(n);var s=this.addHandler(Lt.SOURCE,r,n);return this.store.dispatch(Ow(s)),s}},{key:"addTarget",value:function(r,n){Da(r,!0),Qw(n);var s=this.addHandler(Lt.TARGET,r,n);return this.store.dispatch(Dw(s)),s}},{key:"containsHandler",value:function(r){return $d(this.dragSources,r)||$d(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;oe(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,i=s?this.pinnedSource:this.dragSources.get(r);return i}},{key:"getTarget",value:function(r){return oe(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return oe(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return oe(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Fd(r);return n===Lt.SOURCE}},{key:"isTargetId",value:function(r){var n=Fd(r);return n===Lt.TARGET}},{key:"removeSource",value:function(r){var n=this;oe(this.getSource(r),"Expected an existing source."),this.store.dispatch(Tw(r)),tS(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){oe(this.getTarget(r),"Expected an existing target."),this.store.dispatch(Iw(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);oe(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){oe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var i=uS(r);return this.types.set(i,n),r===Lt.SOURCE?this.dragSources.set(i,s):r===Lt.TARGET&&this.dropTargets.set(i,s),i}}]),e}();function fS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=hS(n),i=new qw(s,new dS(s)),o=new pw(s,i),a=e(o,t,r);return o.receiveBackend(a),o}function hS(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Sd($w,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var pS=["children"];function gS(e,t){return bS(e)||mS(e,t)||vS(e,t)||yS()}function yS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
458
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vS(e,t){if(e){if(typeof e=="string")return Bd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bd(e,t)}}function Bd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mS(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function bS(e){if(Array.isArray(e))return e}function _S(e,t){if(e==null)return{};var r=wS(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wS(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var jd=0,Li=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),SS=p.memo(function(t){var r=t.children,n=_S(t,pS),s=CS(n),i=gS(s,2),o=i[0],a=i[1];return p.useEffect(function(){if(a){var c=Vd();return++jd,function(){--jd===0&&(c[Li]=null)}}},[]),l.jsx(pd.Provider,Object.assign({value:o},{children:r}),void 0)});function CS(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=ES(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function ES(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vd(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[Li]||(s[Li]={dragDropManager:fS(e,t,r,n)}),s[Li]}function Vd(){return typeof global<"u"?global:window}function OS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function TS(e,t,r){return t&&DS(e.prototype,t),e}function Ud(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ta=!1,Ia=!1,IS=function(){function e(t){OS(this,e),Ud(this,"internalMonitor",void 0),Ud(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return TS(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){oe(!Ta,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ta=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ta=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;oe(!Ia,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ia=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ia=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function NS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function kS(e,t,r){return t&&xS(e.prototype,t),e}function zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Na=!1,AS=function(){function e(t){NS(this,e),zd(this,"internalMonitor",void 0),zd(this,"targetId",null),this.internalMonitor=t.getMonitor()}return kS(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;oe(!Na,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Na=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Na=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function PS(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function MS(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!p.isValidElement(t)){var n=t;return e(n,r),n}var s=t;PS(s);var i=r?function(o){return e(o,r)}:e;return LS(s,i)}}function Hd(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=MS(n);t[r]=function(){return s}}}),t}function qd(e,t){typeof e=="function"?e(t):e.current=t}function LS(e,t){var r=e.ref;return oe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?p.cloneElement(e,{ref:function(s){qd(r,s),qd(t,s)}}):p.cloneElement(e,{ref:t})}function Fi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fi=function(r){return typeof r}:Fi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fi(e)}function xa(e){return e!==null&&Fi(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ka(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<i.length;c++){var u=i[c];if(!a(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function FS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function BS(e,t,r){return t&&$S(e.prototype,t),e}function it(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jS=function(){function e(t){var r=this;FS(this,e),it(this,"hooks",Hd({dragSource:function(s,i){r.clearDragSource(),r.dragSourceOptions=i||null,xa(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,i){r.clearDragPreview(),r.dragPreviewOptions=i||null,xa(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),it(this,"handlerId",null),it(this,"dragSourceRef",null),it(this,"dragSourceNode",void 0),it(this,"dragSourceOptionsInternal",null),it(this,"dragSourceUnsubscribe",void 0),it(this,"dragPreviewRef",null),it(this,"dragPreviewNode",void 0),it(this,"dragPreviewOptionsInternal",null),it(this,"dragPreviewUnsubscribe",void 0),it(this,"lastConnectedHandlerId",null),it(this,"lastConnectedDragSource",null),it(this,"lastConnectedDragSourceOptions",null),it(this,"lastConnectedDragPreview",null),it(this,"lastConnectedDragPreviewOptions",null),it(this,"backend",void 0),this.backend=t}return BS(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!ka(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ka(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e}();function VS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function US(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function zS(e,t,r){return t&&US(e.prototype,t),e}function er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var HS=function(){function e(t){var r=this;VS(this,e),er(this,"hooks",Hd({dropTarget:function(s,i){r.clearDropTarget(),r.dropTargetOptions=i,xa(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),er(this,"handlerId",null),er(this,"dropTargetRef",null),er(this,"dropTargetNode",void 0),er(this,"dropTargetOptionsInternal",null),er(this,"unsubscribeDropTarget",void 0),er(this,"lastConnectedHandlerId",null),er(this,"lastConnectedDropTarget",null),er(this,"lastConnectedDropTargetOptions",null),er(this,"backend",void 0),this.backend=t}return zS(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!ka(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e}();function qS(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function WS(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var Hr=typeof window<"u"?p.useLayoutEffect:p.useEffect;function $i(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$i=function(r){return typeof r}:$i=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$i(e)}function KS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function QS(e,t,r){return t&&GS(e.prototype,t),e}function Aa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var YS=function(){function e(t,r,n){KS(this,e),Aa(this,"spec",void 0),Aa(this,"monitor",void 0),Aa(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return QS(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,i=null;return $i(n.item)==="object"?i=n.item:typeof n.item=="function"?i=n.item(s):i={},(r=i)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var s=this.spec,i=this.monitor,o=s.isDragging;return o?o(i):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,i=r.end;i&&i(n.getItem(),n),s.reconnect()}}]),e}();function RS(e,t,r){var n=p.useMemo(function(){return new YS(e,t,r)},[t,r]);return p.useEffect(function(){n.spec=e},[e]),n}function qr(){var e=p.useContext(pd),t=e.dragDropManager;return oe(t!=null,"Expected drag drop context"),t}function XS(e){return p.useMemo(function(){var t=e.type;return oe(t!=null,"spec.type must be defined"),t},[e])}function ZS(e,t){return r1(e)||t1(e,t)||e1(e,t)||JS()}function JS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e1(e,t){if(e){if(typeof e=="string")return Wd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wd(e,t)}}function Wd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function r1(e){if(Array.isArray(e))return e}function n1(e,t,r){var n=qr(),s=RS(e,t,r),i=XS(e);Hr(function(){if(i!=null){var a=WS(i,s,n),c=ZS(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,i])}function s1(e){return l1(e)||a1(e)||o1(e)||i1()}function i1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
460
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o1(e,t){if(e){if(typeof e=="string")return Pa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pa(e,t)}}function a1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l1(e){if(Array.isArray(e))return Pa(e)}function Pa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kd(e,t){var r=s1(t||[]);return t==null&&typeof e!="function"&&r.push(e),p.useMemo(function(){return typeof e=="function"?e():e},r)}function c1(){var e=qr();return p.useMemo(function(){return new IS(e)},[e])}function u1(e,t){var r=qr(),n=p.useMemo(function(){return new jS(r.getBackend())},[r]);return Hr(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Hr(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var d1=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r};const f1=Bc(d1);function h1(e,t){return v1(e)||y1(e,t)||g1(e,t)||p1()}function p1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
461
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g1(e,t){if(e){if(typeof e=="string")return Gd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gd(e,t)}}function Gd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function v1(e){if(Array.isArray(e))return e}function Qd(e,t,r){var n=p.useState(function(){return t(e)}),s=h1(n,2),i=s[0],o=s[1],a=p.useCallback(function(){var c=t(e);f1(i,c)||(o(c),r&&r())},[i,e,r]);return Hr(a),[i,a]}function m1(e,t){return S1(e)||w1(e,t)||_1(e,t)||b1()}function b1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
462
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _1(e,t){if(e){if(typeof e=="string")return Yd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yd(e,t)}}function Yd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function w1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function S1(e){if(Array.isArray(e))return e}function C1(e,t,r){var n=Qd(e,t,r),s=m1(n,2),i=s[0],o=s[1];return Hr(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(o,{handlerIds:[c]})},[e,o]),i}function Rd(e,t,r){return C1(t,e||function(){return{}},function(){return r.reconnect()})}function E1(e){return p.useMemo(function(){return e.hooks.dragSource()},[e])}function O1(e){return p.useMemo(function(){return e.hooks.dragPreview()},[e])}function D1(e,t){var r=Kd(e,t);oe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=c1(),s=u1(r.options,r.previewOptions);return n1(r,n,s),[Rd(r.collect,n,s),E1(s),O1(s)]}function T1(e){var t=e.accept;return p.useMemo(function(){return oe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function I1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x1(e,t,r){return t&&N1(e.prototype,t),e}function Xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var k1=function(){function e(t,r){I1(this,e),Xd(this,"spec",void 0),Xd(this,"monitor",void 0),this.spec=t,this.monitor=r}return x1(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e}();function A1(e,t){var r=p.useMemo(function(){return new k1(e,t)},[t]);return p.useEffect(function(){r.spec=e},[e]),r}function P1(e,t){return $1(e)||F1(e,t)||L1(e,t)||M1()}function M1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
463
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L1(e,t){if(e){if(typeof e=="string")return Zd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zd(e,t)}}function Zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function F1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function $1(e){if(Array.isArray(e))return e}function B1(e,t,r){var n=qr(),s=A1(e,t),i=T1(e);Hr(function(){var a=qS(i,s,n),c=P1(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,i.map(function(o){return o.toString()}).join("|")])}function j1(){var e=qr();return p.useMemo(function(){return new AS(e)},[e])}function V1(e){var t=qr(),r=p.useMemo(function(){return new HS(t.getBackend())},[t]);return Hr(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function U1(e){return p.useMemo(function(){return e.hooks.dropTarget()},[e])}function Jd(e,t){var r=Kd(e,t),n=j1(),s=V1(r.options);return B1(r,n,s),[Rd(r.collect,n,s),U1(s)]}function z1(e,t){return K1(e)||W1(e,t)||q1(e,t)||H1()}function H1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
464
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q1(e,t){if(e){if(typeof e=="string")return ef(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ef(e,t)}}function ef(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function W1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function K1(e){if(Array.isArray(e))return e}function G1(e){var t=qr(),r=t.getMonitor(),n=Qd(r,e),s=z1(n,2),i=s[0],o=s[1];return p.useEffect(function(){return r.subscribeToOffsetChange(o)}),p.useEffect(function(){return r.subscribeToStateChange(o)}),i}function tf(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function Q1(e,t){return e.filter(function(r){return r!==t})}function Y1(e,t){var r=new Set,n=function(o){return r.add(o)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i){return s.push(i)}),s}function R1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Z1(e,t,r){return t&&X1(e.prototype,t),e}function rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J1=function(){function e(t){R1(this,e),rf(this,"entered",[]),rf(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return Z1(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,i=function(a){return n.isNodeInDocument(a)&&(!a.contains||a.contains(r))};return this.entered=Y1(this.entered.filter(i),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=Q1(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),eC=tf(function(){return/firefox/i.test(navigator.userAgent)}),nf=tf(function(){return!!window.safari});function tC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nC(e,t,r){return t&&rC(e.prototype,t),e}function _s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sf=function(){function e(t,r){tC(this,e),_s(this,"xs",void 0),_s(this,"ys",void 0),_s(this,"c1s",void 0),_s(this,"c2s",void 0),_s(this,"c3s",void 0);for(var n=t.length,s=[],i=0;i<n;i++)s.push(i);s.sort(function(A,B){return t[A]<t[B]?-1:1});for(var o=[],a=[],c,u,d=0;d<n-1;d++)c=t[d+1]-t[d],u=r[d+1]-r[d],o.push(c),a.push(u/c);for(var f=[a[0]],y=0;y<o.length-1;y++){var g=a[y],b=a[y+1];if(g*b<=0)f.push(0);else{c=o[y];var h=o[y+1],v=c+h;f.push(3*v/((v+h)/g+(v+c)/b))}}f.push(a[a.length-1]);for(var m=[],_=[],S,w=0;w<f.length-1;w++){S=a[w];var C=f[w],D=1/o[w],x=C+f[w+1]-S-S;m.push((S-C-x)*D),_.push(x*D*D)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=m,this.c3s=_}return nC(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var u=0,d=a.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var y=n[f];if(y<r)u=f+1;else if(y>r)d=f-1;else return s[f]}c=Math.max(0,d);var g=r-n[c],b=g*g;return s[c]+i[c]*g+o[c]*b+a[c]*g*b}}]),e}(),sC=1;function of(e){var t=e.nodeType===sC?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function Bi(e){return{x:e.clientX,y:e.clientY}}function iC(e){var t;return e.nodeName==="IMG"&&(eC()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function oC(e,t,r,n){var s=e?t.width:r,i=e?t.height:n;return nf()&&e&&(i/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:i}}function aC(e,t,r,n,s){var i=iC(t),o=i?e:t,a=of(o),c={x:r.x-a.x,y:r.y-a.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,y=n.anchorY,g=oC(i,t,u,d),b=g.dragPreviewWidth,h=g.dragPreviewHeight,v=function(){var x=new sf([0,.5,1],[c.y,c.y/d*h,c.y+h-d]),A=x.interpolate(y);return nf()&&i&&(A+=(window.devicePixelRatio-1)*h),A},m=function(){var x=new sf([0,.5,1],[c.x,c.x/u*b,c.x+b-u]);return x.interpolate(f)},_=s.offsetX,S=s.offsetY,w=_===0||_,C=S===0||S;return{x:w?_:m(),y:C?S:v()}}var af="__NATIVE_FILE__",lf="__NATIVE_URL__",cf="__NATIVE_TEXT__",uf="__NATIVE_HTML__";const df=Object.freeze(Object.defineProperty({__proto__:null,FILE:af,HTML:uf,TEXT:cf,URL:lf},Symbol.toStringTag,{value:"Module"}));function Ma(e,t,r){var n=t.reduce(function(s,i){return s||e.getData(i)},"");return n??r}var In;function ji(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var La=(In={},ji(In,af,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ji(In,uf,{exposeProperties:{html:function(t,r){return Ma(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ji(In,lf,{exposeProperties:{urls:function(t,r){return Ma(t,r,"").split(`
|
|
465
|
+
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ji(In,cf,{exposeProperties:{text:function(t,r){return Ma(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),In);function lC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function uC(e,t,r){return t&&cC(e.prototype,t),e}function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var dC=function(){function e(t){lC(this,e),ff(this,"item",void 0),ff(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return uC(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var s={};Object.keys(this.config.exposeProperties).forEach(function(i){s[i]={value:n.config.exposeProperties[i](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function fC(e,t){var r=new dC(La[e]);return r.loadDataTransfer(t),r}function Fa(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(La).filter(function(r){var n=La[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function hC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function gC(e,t,r){return t&&pC(e.prototype,t),e}function $a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yC=function(){function e(t,r){hC(this,e),$a(this,"ownerDocument",null),$a(this,"globalContext",void 0),$a(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return gC(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e}();function hf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hf(Object(r),!0).forEach(function(n){fe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bC(e,t,r){return t&&mC(e.prototype,t),e}function fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _C=function(){function e(t,r,n){var s=this;vC(this,e),fe(this,"options",void 0),fe(this,"actions",void 0),fe(this,"monitor",void 0),fe(this,"registry",void 0),fe(this,"enterLeaveCounter",void 0),fe(this,"sourcePreviewNodes",new Map),fe(this,"sourcePreviewNodeOptions",new Map),fe(this,"sourceNodes",new Map),fe(this,"sourceNodeOptions",new Map),fe(this,"dragStartSourceIds",null),fe(this,"dropTargetIds",[]),fe(this,"dragEnterTargetIds",[]),fe(this,"currentNativeSource",null),fe(this,"currentNativeHandle",null),fe(this,"currentDragSourceNode",null),fe(this,"altKeyPressed",!1),fe(this,"mouseMoveTimeoutTimer",null),fe(this,"asyncEndDragFrameId",null),fe(this,"dragOverTargetIds",null),fe(this,"lastClientOffset",null),fe(this,"hoverRafId",null),fe(this,"getSourceClientOffset",function(i){var o=s.sourceNodes.get(i);return o&&of(o)||null}),fe(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),fe(this,"isNodeInDocument",function(i){return!!(i&&s.document&&s.document.body&&s.document.body.contains(i))}),fe(this,"endDragIfSourceWasRemovedFromDOM",function(){var i=s.currentDragSourceNode;i==null||s.isNodeInDocument(i)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),fe(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),fe(this,"handleTopDragStart",function(i){if(!i.defaultPrevented){var o=s.dragStartSourceIds;s.dragStartSourceIds=null;var a=Bi(i);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:a});var c=i.dataTransfer,u=Fa(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),y=s.sourcePreviewNodes.get(d)||f;if(y){var g=s.getCurrentSourcePreviewNodeOptions(),b=g.anchorX,h=g.anchorY,v=g.offsetX,m=g.offsetY,_={anchorX:b,anchorY:h},S={offsetX:v,offsetY:m},w=aC(f,y,a,_,S);c.setDragImage(y,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(i.target);var C=s.getCurrentSourcePreviewNodeOptions(),D=C.captureDraggingState;D?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}}}),fe(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),fe(this,"handleTopDragEnterCapture",function(i){s.dragEnterTargetIds=[];var o=s.enterLeaveCounter.enter(i.target);if(!(!o||s.monitor.isDragging())){var a=i.dataTransfer,c=Fa(a);c&&s.beginDragNativeItem(c,a)}}),fe(this,"handleTopDragEnter",function(i){var o=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=i.altKey,o.length>0&&s.actions.hover(o,{clientOffset:Bi(i)});var a=o.some(function(c){return s.monitor.canDropOnTarget(c)});a&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),fe(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),fe(this,"handleTopDragOver",function(i){var o=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}s.altKeyPressed=i.altKey,s.lastClientOffset=Bi(i),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(o||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var a=(o||[]).some(function(c){return s.monitor.canDropOnTarget(c)});a?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))}),fe(this,"handleTopDragLeaveCapture",function(i){s.isDraggingNativeItem()&&i.preventDefault();var o=s.enterLeaveCounter.leave(i.target);o&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),fe(this,"handleTopDropCapture",function(i){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var o;i.preventDefault(),(o=s.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else Fa(i.dataTransfer)&&i.preventDefault();s.enterLeaveCounter.reset()}),fe(this,"handleTopDrop",function(i){var o=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(o,{clientOffset:Bi(i)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),fe(this,"handleSelectStart",function(i){var o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))}),this.options=new yC(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new J1(this.isNodeInDocument)}return bC(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,s){var i=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){i.sourcePreviewNodes.delete(r),i.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var i=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var o=function(u){return i.handleDragStart(u,r)},a=function(u){return i.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(r),i.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,i=function(u){return s.handleDragEnter(u,r)},o=function(u){return s.handleDragOver(u,r)},a=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return pf({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return pf({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(df).some(function(n){return df[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=fC(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var i;return(i=n.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e}(),Vi;function wC(){return Vi||(Vi=new Image,Vi.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Vi}var SC=function(t,r,n){return new _C(t,r,n)};function CC(e,t){return typeof e=="function"?e(t):e??"NODE"}function EC(e){return e.isDraggable&&!e.isEditing}function OC(e){const t=bt(),r=t.selectedIds,[n,s,i]=D1(()=>({canDrag:()=>EC(e),type:CC(t.props.dragType,e),item:()=>{const o=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(Cn.dragStart(e.id,o)),{id:e.id,dragIds:o,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(Cn.dragEnd())}}),[r,e,t.props.dragType]);return p.useEffect(()=>{i(wC())},[i]),s}function DC(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),i=r.height,o=s<i/2,a=!o,c=i/4,u=s>c&&s<i-c;return{x:n,inTopHalf:o,inBottomHalf:a,inMiddle:u,atTop:!u&&o,atBottom:!u&&a}}function TC(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Ui(e,t){return{parentId:e||null,index:t}}function Nn(e,t){return{type:"line",index:e,level:t}}function IC(e){return{type:"highlight",id:e}}function Ba(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,i=Yu(n)+1;return{parentId:s,index:i}}function gf(e){var t;const r=DC(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:i,nextNode:o,prevNode:a}=e,[c,u]=TC(i,a,o,r);if(i&&i.isInternal&&r.inMiddle)return{drop:Ui(i.id,null),cursor:IC(i.id)};if(!c)return{drop:Ui((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Nn(0,0)};if(Wu(c)){const d=Ci(s,(u==null?void 0:u.level)||0,c.level);return{drop:Ba(c,d),cursor:Nn(c.rowIndex+1,d)}}if(Ku(c)){const d=Ci(s,(u==null?void 0:u.level)||0,c.level);return{drop:Ba(c,d),cursor:Nn(c.rowIndex+1,d)}}if(Gu(c)){const d=Ci(s,0,c.level+1);return d>c.level?{drop:Ui(c.id,0),cursor:Nn(c.rowIndex+1,d)}:{drop:Ba(c,d),cursor:Nn(c.rowIndex+1,d)}}return{drop:Ui(c==null?void 0:c.id,0),cursor:Nn(c.rowIndex+1,c.level+1)}}function NC(e,t){const r=bt(),[n,s]=Jd(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(i,o)=>{const a=o.getClientOffset();if(!e.current||!a)return;const{cursor:c,drop:u}=gf({element:e.current,offset:a,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(Cn.hovering(u.parentId,u.index)),o.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(i,o)=>{if(!o.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function xC(e){const t=bt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return p.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const yf=p.memo(function({index:t,style:r}){qu(),Qb();const n=bt(),s=xC(t),i=p.useRef(null),o=OC(s),a=NC(i,s),c=p.useCallback(h=>{i.current=h,a(h)},[a]),u=n.indent*s.level,d=p.useMemo(()=>({paddingLeft:u}),[u]),f=p.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),y={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};p.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,i.current]);const g=n.renderNode,b=n.renderRow;return l.jsx(b,{node:s,innerRef:c,attrs:y,children:l.jsx(g,{node:s,tree:n,style:d,dragHandle:o})})});let ja="",vf=null;function mf(){qu();const e=bt();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const s=Array.from(e.selectedIds);if(s.length>1){let i=e.mostRecentNode;for(;i&&i.isSelected;)i=i.nextSibling;i||(i=e.lastNode),e.focus(i,{scroll:!1}),e.delete(Array.from(s))}else{const i=e.focusedNode;if(i){const o=i.nextSibling,a=i.parent;e.focus(o||a,{scroll:!1}),e.delete(i)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Ru(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Xu(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const i=e.focusedNode;i?i.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const i=e.focusedNode;i?i.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(vf),ja+=t.key,vf=setTimeout(()=>{ja=""},600);const n=e.visibleNodes.find(s=>{const i=s.data.name;return typeof i=="string"?i.toLowerCase().startsWith(ja):!1});n&&e.focus(n.id)},children:l.jsx(kC,{})})}function kC(){var e,t;const r=bt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var i;return((i=r.visibleNodes[s])===null||i===void 0?void 0:i.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:F_,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:j_,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(A_,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:yf})):l.jsx(P_,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:yf}))}function bf(e){return e.isFiltered?PC(e.root,e.isMatch.bind(e)):AC(e.root)}function AC(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(_f),t}function PC(e,t){const r={},n=[];function s(o){if(!o.isRoot&&t(o)){r[o.id]=!0;let c=o.parent;for(;c;)r[c.id]=!0,c=c.parent}if(o.children)for(let c of o.children)s(c)}function i(o){var a;o.level>=0&&r[o.id]&&n.push(o),o.isOpen&&((a=o.children)===null||a===void 0||a.forEach(i))}return s(e),i(e),n.forEach(_f),n}function _f(e,t){e.rowIndex=t}const wf=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var Va=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:ot}=Jb;class ws{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=i=>{const o=this.props.rowHeight;if(typeof o=="function"){const a=this.at(i);return a?o(a):this.rowHeight}return o??24},this.rowTopPosition=i=>{if(typeof this.props.rowHeight!="function")return i*this.rowHeight;const o=this.getRowOffsets(),a=Math.max(0,Math.min(i,o.length-1));return o[a]},this.redrawList=(i=0)=>{this.rowOffsets=null;const o=this.list.current;o&&"resetAfterIndex"in o&&o.resetAfterIndex(Math.max(0,i))},this.root=rd(this),this.visibleNodes=bf(this),this.idToIndex=wf(this.visibleNodes)}update(t){this.props=t,this.root=rd(this),this.visibleNodes=bf(this),this.idToIndex=wf(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:(n,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase());return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=ys(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=ys(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof ms)return t.id;const r=this.props.idAccessor||"id";return ys(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,i=this.indexOf(r);if(i===null)return[];const o=Math.min(s,i),a=Math.max(s,i);return this.visibleNodes.slice(o,a+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Va(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?td(this):t.parentId,i=(r=t.index)!==null&&r!==void 0?r:ed(this),o=(n=t.type)!==null&&n!==void 0?n:"leaf",a=yield ot(this.props.onCreate,{type:o,parentId:s,index:i,parentNode:this.get(s)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(t){return Va(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(o=>this.identify(o)),s=n.map(o=>this.get(o)).filter(o=>!!o),i=s.length?Math.min(...s.map(o=>{var a;return(a=o.rowIndex)!==null&&a!==void 0?a:0})):0;yield ot(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(i)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(ha(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(i=>{ws.editPromise=i})}submit(t,r){return Va(this,void 0,void 0,function*(){var n,s;if(!t)return;const i=this.identify(t);yield ot(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(ha(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(ha(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&ot(this.props.onActivate,r)}resolveEdit(t){const r=ws.editPromise;r&&r(t),ws.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(wn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&ot(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,i=this.visibleStopIndex-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o>n?o=n:o=Math.max(n-i,0),this.focus(this.at(o))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,i=s-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o<s?o=s:o=Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,i=this.identify(t);s&&this.dispatch(wn(i)),!((n=this.get(i))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[i],anchor:i,mostRecent:i}),this.scrollTo(i,r.align),this.focusedNode&&s&&ot(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Cr.remove(r)),ot(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch(wn(n.id)),n.isSelectable&&(this.dispatch(Cr.add(n.id)),this.dispatch(Cr.anchor(n.id)),this.dispatch(Cr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&ot(this.props.onFocus,this.focusedNode),ot(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(wn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:i}=this.state.nodes.selection,o=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(Cr.remove(this.nodesBetween(s,i))),this.dispatch(Cr.add(o)),this.dispatch(Cr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&ot(this.props.onFocus,this.focusedNode),ot(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch(wn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&ot(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(o=>this.identify(o))),s=this.identifyNull(t.anchor),i=this.identifyNull(t.mostRecent);this.dispatch(Cr.set({ids:n,anchor:s,mostRecent:i})),ot(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,s=this.props.disableDrop;for(const i of n)if(!i||!r||i.isInternal&&Qu(r,i))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;ot(this.props.onMove,{dragIds:n,parentId:t===vs?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(Cn.cursor({type:"none"}))}showCursor(t){this.dispatch(Cn.cursor(t))}open(t,r=!0){var n,s;const i=this.identifyNull(t);i&&(this.isOpen(i)||(this.dispatch(pa.open(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),ot(this.props.onToggle,i)))}close(t,r=!0){var n,s;const i=this.identifyNull(t);i&&this.isOpen(i)&&(this.dispatch(pa.close(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),ot(this.props.onToggle,i))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=fa(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){Ei(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Ei(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Ju(()=>n in this.idToIndex).then(()=>{var s;const i=this.idToIndex[n];i!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(i,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,s;if(!t)return!1;if(t===vs)return!0;const i=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:i}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!ys(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(wn(t.id))}onBlur(){this.dispatch(c_())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||mf}get renderRow(){return this.props.renderRow||s_}get renderNode(){return this.props.children||i_}get renderDragPreview(){return this.props.renderDragPreview||sd}get renderCursor(){return this.props.renderCursor||n_}}function at(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var MC=typeof Symbol=="function"&&Symbol.observable||"@@observable",Sf=MC,Ua=()=>Math.random().toString(36).substring(7).split("").join("."),LC={INIT:`@@redux/INIT${Ua()}`,REPLACE:`@@redux/REPLACE${Ua()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ua()}`},Wr=LC;function Cf(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function FC(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(jC(e))return"date";if(BC(e))return"error";const r=$C(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function $C(e){return typeof e.constructor=="function"?e.constructor.name:null}function BC(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function jC(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Er(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=FC(e)),t}function Ef(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?at(2):`Expected the root reducer to be a function. Instead, received: '${Er(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?at(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?at(1):`Expected the enhancer to be a function. Instead, received: '${Er(r)}'`);return r(Ef)(e,t)}let n=e,s=t,i=new Map,o=i,a=0,c=!1;function u(){o===i&&(o=new Map,i.forEach((v,m)=>{o.set(m,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?at(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?at(4):`Expected the listener to be a function. Instead, received: '${Er(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?at(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let m=!0;u();const _=a++;return o.set(_,v),function(){if(m){if(c)throw new Error(process.env.NODE_ENV==="production"?at(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");m=!1,u(),o.delete(_),i=null}}}function y(v){if(!Cf(v))throw new Error(process.env.NODE_ENV==="production"?at(7):`Actions must be plain objects. Instead, the actual type was: '${Er(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?at(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?at(17):`Action "type" property must be a string. Instead, the actual type was: '${Er(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?at(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(_=>{_()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?at(10):`Expected the nextReducer to be a function. Instead, received: '${Er(v)}`);n=v,y({type:Wr.REPLACE})}function b(){const v=f;return{subscribe(m){if(typeof m!="object"||m===null)throw new Error(process.env.NODE_ENV==="production"?at(11):`Expected the observer to be an object. Instead, received: '${Er(m)}'`);function _(){const w=m;w.next&&w.next(d())}return _(),{unsubscribe:v(_)}},[Sf](){return this}}}return y({type:Wr.INIT}),{dispatch:y,subscribe:f,getState:d,replaceReducer:g,[Sf]:b}}function Of(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function VC(e,t,r,n){const s=Object.keys(t),i=r&&r.type===Wr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Cf(e))return`The ${i} has unexpected type of "${Er(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!n[a]);if(o.forEach(a=>{n[a]=!0}),!(r&&r.type===Wr.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function UC(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Wr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?at(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Wr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?at(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Wr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Df(e){const t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Of(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let i;try{UC(r)}catch(o){i=o}return function(a={},c){if(i)throw i;if(process.env.NODE_ENV!=="production"){const f=VC(a,r,c,s);f&&Of(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const y=n[f],g=r[y],b=a[y],h=g(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?at(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${y}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[y]=h,u=u||h!==b}return u=u||n.length!==Object.keys(a).length,u?d:a}}function zC(e=Sn().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const HC=Df({nodes:Df({focus:u_,edit:l_,open:d_,selection:f_,drag:zC}),dnd:h_}),qC=Sn();function WC({treeProps:e,imperativeHandle:t,children:r}){const n=p.useRef(null),s=p.useRef(null),i=p.useRef(Ef(HC,Sn(e))),o=Gb.useSyncExternalStore(i.current.subscribe,i.current.getState,()=>qC),a=p.useMemo(()=>new ws(i.current,e,n,s),[]),c=p.useRef(0);return p.useMemo(()=>{c.current+=1,a.update(e)},Object.values(e)),p.useMemo(()=>{c.current+=1,a.update(a.props)},[o.nodes.open]),p.useImperativeHandle(t,()=>a),p.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),p.useEffect(()=>{a.props.searchTerm||i.current.dispatch(pa.clear(!0))},[a.props.searchTerm]),l.jsx(Vu.Provider,{value:a,children:l.jsx(Hu.Provider,{value:c.current,children:l.jsx(Uu.Provider,{value:o.nodes,children:l.jsx(zu.Provider,{value:o.dnd,children:l.jsx(SS,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||SC,options:{rootElement:a.props.dndRootElement||void 0}},{children:r}))})})})})}function KC(){const e=bt(),[,t]=Jd(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:i,drop:o}=gf({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(Cn.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function GC(e){return KC(),e.children}function QC(){const t=bt().props.renderContainer||mf;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function YC(){const e=bt(),{offset:t,mouse:r,item:n,isDragging:s}=G1(o=>({offset:o.getSourceClientOffset(),mouse:o.getClientOffset(),item:o.getItem(),isDragging:o.isDragging()})),i=e.props.renderDragPreview||sd;return l.jsx(i,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function RC(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:i=>i[n],getChildren:typeof s=="function"?s:i=>i[s],childrenKey:typeof s=="string"?s:"children"}}class XC{constructor(t,r={}){this.accessors=RC(r),this.root=ZC(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const s=this.find(t,n);if(s)return s}return null}return null}}function ZC(e,t){const r=new Tf({},null,t,"ROOT");return r.children=e.map(n=>za(n,r,t)),r}function za(e,t,r){const n=new Tf(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(i=>za(i,n,r))),n}class Tf{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const i=za(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,i);const o=this.accessors.childrenKey,a=this.data;a[o]=(s=a[o])!==null&&s!==void 0?s:[],a[o].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let JC=0;function e0(e,t={}){const[r,n]=p.useState(e),s=t.idAccessor,i=t.childrenAccessor,o=p.useMemo(()=>new XC(r,{idAccessor:s,childrenAccessor:i}),[r,s,i]),a=b=>{for(const h of b.dragIds)o.move({id:h,parentId:b.parentId,index:b.index});n(o.data)},c=({name:b,id:h})=>{o.update({id:h,changes:{name:b}}),n(o.data)},u=typeof s=="string"?s:"id",d=typeof i=="string"?i:"children";return[r,{onMove:a,onRename:c,onCreate:({parentId:b,index:h,type:v})=>{if(typeof s=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof i=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const m={[u]:`simple-tree-id-${JC++}`,name:""};return v==="internal"&&(m[d]=[]),o.create({parentId:b,index:h,data:m}),n(o.data),m},onDelete:b=>{b.ids.forEach(h=>o.drop({id:h})),n(o.data)}}]}function t0(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
466
|
+
Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=e0(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function r0(e,t){const r=t0(e);return l.jsxs(WC,{treeProps:r,imperativeHandle:t,children:[l.jsx(GC,{children:l.jsx(QC,{})}),l.jsx(YC,{})]})}const n0=p.forwardRef(r0),If={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",default:"#6B7280"},Nf={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",default:"File"},xf=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],s0=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"}];function i0(e){const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":"default"}function zi(e){const t=i0(e);return{key:t,color:If[t]??If.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Nf[t]??Nf.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const Dt={row:"_row_10dbr_1",grip:"_grip_10dbr_16",menuBtn:"_menuBtn_10dbr_19",selected:"_selected_10dbr_23",title:"_title_10dbr_28",dropTarget:"_dropTarget_10dbr_33",toggle:"_toggle_10dbr_50",ctIcon:"_ctIcon_10dbr_65",renameInput:"_renameInput_10dbr_86",dropHere:"_dropHere_10dbr_95",menuWrap:"_menuWrap_10dbr_105",menu:"_menu_10dbr_19",dangerItem:"_dangerItem_10dbr_157"},o0={video:zo,pdf:Fo,h5p:$o,scorm:jo,audio:Bo,quiz:Mo,default:hn},a0=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[s,i]=p.useState(!1),[o,a]=p.useState(!1),[c,u]=p.useState(e.data.name),d=p.useRef(null),f=n==="edit",y=zi(e.data),g=o0[y.key]??hn,b=e.isSelected,h=e.data.isFolder??(e.children&&e.children.length>0);p.useEffect(()=>{if(!s)return;const _=S=>{var w;(w=d.current)!=null&&w.contains(S.target)||i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[s]);const v=p.useCallback(()=>{c.trim()&&e.submit(c.trim()),a(!1)},[c,e]),m=p.useCallback(_=>{_.key==="Enter"&&v(),_.key==="Escape"&&(u(e.data.name),a(!1))},[v,e.data.name]);return l.jsxs("div",{className:[Dt.row,b?Dt.selected:"",e.state.isOver&&h?Dt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":h?"true":void 0,role:"treeitem","aria-selected":b,"aria-expanded":h?!e.isClosed:void 0,children:[f&&l.jsx("span",{ref:r,className:Dt.grip,"aria-hidden":"true",children:l.jsx(Pc,{size:14})}),l.jsx("button",{className:Dt.toggle,onClick:_=>{_.stopPropagation(),e.toggle()},"aria-label":e.isClosed?"Expand":"Collapse",style:{visibility:h?"visible":"hidden"},children:e.isClosed?l.jsx(Nc,{size:14}):l.jsx(ls,{size:14})}),l.jsx("span",{className:`${Dt.ctIcon} ${y.bgClass}`,"aria-hidden":"true",children:l.jsx(g,{size:12})}),o?l.jsx("input",{className:Dt.renameInput,value:c,autoFocus:!0,onChange:_=>u(_.target.value),onBlur:v,onKeyDown:m,onClick:_=>_.stopPropagation()}):l.jsx("span",{className:Dt.title,onDoubleClick:()=>f&&a(!0),children:e.data.name}),e.state.isOver&&h&&l.jsx("span",{className:Dt.dropHere,"aria-hidden":"true",children:"Drop here"}),f&&l.jsxs("div",{className:Dt.menuWrap,ref:d,children:[l.jsx("button",{className:Dt.menuBtn,onClick:_=>{_.stopPropagation(),i(S=>!S)},"aria-label":"Node options",children:l.jsx(kc,{size:14})}),s&&l.jsxs("div",{className:Dt.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{a(!0),i(!1)},children:[l.jsx(dv,{size:13})," Rename"]}),h&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),i(!1)},children:[l.jsx(Ac,{size:13})," Add sub-unit"]}),e.data.parent&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),i(!1)},children:[l.jsx(cs,{size:13})," Add Sibling"]}),l.jsxs("button",{role:"menuitem",className:Dt.dangerItem,onClick:()=>{e.tree.delete(e.id),i(!1)},children:[l.jsx(Uo,{size:13})," Delete"]})]})]})]})};async function l0(e,t){var i,o;const n=((i=(await Ue.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:i.result)??{},s=((o=n.content)==null?void 0:o.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function c0(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function u0(e,t){var o;const r=await l0(e,t.name),n=await c0(r,t);return{processId:(((o=(await Ue.post(`/action/collection/v1/import/${e}`,{request:{fileUrl:n,mimeType:"text/csv"}})).data)==null?void 0:o.result)??{}).processId??""}}async function d0(e){var r;return((r=(await Ue.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function kf(e){var n,s,i;const r=(i=(s=(n=(await Ue.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:i.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function f0(e){return kf(e)}const Ce={container:"_container_1m4t0_1",header:"_header_1m4t0_13",title:"_title_1m4t0_22",closeBtn:"_closeBtn_1m4t0_29",body:"_body_1m4t0_45",dropZone:"_dropZone_1m4t0_54",dragOver:"_dragOver_1m4t0_67",hasFile:"_hasFile_1m4t0_72",hiddenInput:"_hiddenInput_1m4t0_78",fileInfo:"_fileInfo_1m4t0_82",fileIcon:"_fileIcon_1m4t0_89",fileName:"_fileName_1m4t0_93",fileSize:"_fileSize_1m4t0_100",dropHint:"_dropHint_1m4t0_105",dropIcon:"_dropIcon_1m4t0_112",dropText:"_dropText_1m4t0_117",dropSubtext:"_dropSubtext_1m4t0_124",sampleLink:"_sampleLink_1m4t0_130",statusBar:"_statusBar_1m4t0_145",status_uploading:"_status_uploading_1m4t0_154",status_processing:"_status_processing_1m4t0_154",status_done:"_status_done_1m4t0_159",status_error:"_status_error_1m4t0_164",successDetail:"_successDetail_1m4t0_170",spinner:"_spinner_1m4t0_175",spin:"_spin_1m4t0_175",errorMsg:"_errorMsg_1m4t0_191",failedSection:"_failedSection_1m4t0_197",failedTitle:"_failedTitle_1m4t0_203",tableWrap:"_tableWrap_1m4t0_213",failedTable:"_failedTable_1m4t0_219",reasonCell:"_reasonCell_1m4t0_244",footer:"_footer_1m4t0_248"},h0=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const[s,i]=p.useState(null),[o,a]=p.useState(!1),[c,u]=p.useState("idle"),[d,f]=p.useState(""),[y,g]=p.useState([]),[b,h]=p.useState(null),v=p.useRef(null),m=p.useRef(null),_=p.useCallback(()=>{m.current!==null&&(clearInterval(m.current),m.current=null)},[]);p.useEffect(()=>()=>_(),[_]);const S=P=>P.name.toLowerCase().endsWith(".csv")?P.size>10*1024*1024?(f("File size must not exceed 10 MB."),!1):!0:(f("Only .csv files are accepted."),!1),w=p.useCallback(P=>{f(""),g([]),h(null),u("idle"),S(P)&&i(P)},[]),C=p.useCallback(P=>{P.preventDefault(),a(!1);const F=P.dataTransfer.files[0];F&&w(F)},[w]),D=p.useCallback(P=>{var q;const F=(q=P.target.files)==null?void 0:q[0];F&&w(F),P.target.value=""},[w]),x=p.useCallback(async()=>{try{const P=await f0(e),F=document.createElement("a");F.href=P,F.download="sample_hierarchy.csv",F.target="_blank",F.click()}catch{f("Failed to download sample CSV.")}},[e]),A=p.useCallback(async()=>{if(s){u("uploading"),f(""),g([]);try{const{processId:P}=await u0(e,s);if(!P){u("done"),h(null),setTimeout(t,1500);return}u("processing"),m.current=setInterval(async()=>{try{const F=await d0(P);F.status==="COMPLETED"?(_(),u("done"),h(F.successCount??null),F.failedRecords&&F.failedRecords.length>0?g(F.failedRecords):setTimeout(t,1500)):F.status==="FAILED"&&(_(),u("error"),f("Upload processing failed. Please check the error rows below."),F.failedRecords&&g(F.failedRecords))}catch{_(),u("error"),f("Lost connection while checking status. Please try again.")}},2e3)}catch{u("error"),f("Upload failed. Please check your file and try again.")}}},[e,s,t,_]),B={idle:"",uploading:"Uploading...",processing:"Processing...",done:"Done!",error:"Error"};return l.jsxs("div",{className:Ce.container,children:[l.jsxs("div",{className:Ce.header,children:[l.jsx("h2",{className:Ce.title,children:n==="update"?"Update Folder Metadata via CSV":"Create Folders via CSV"}),l.jsx("button",{className:Ce.closeBtn,onClick:r,"aria-label":"Close",children:"✕"})]}),l.jsxs("div",{className:Ce.body,children:[l.jsxs("div",{className:`${Ce.dropZone} ${o?Ce.dragOver:""} ${s?Ce.hasFile:""}`,onDragEnter:P=>{P.preventDefault(),a(!0)},onDragOver:P=>{P.preventDefault(),a(!0)},onDragLeave:P=>{P.preventDefault(),a(!1)},onDrop:C,onClick:()=>{var P;return(P=v.current)==null?void 0:P.click()},role:"button",tabIndex:0,"aria-label":"Drop CSV file here or click to browse",onKeyDown:P=>{var F;return P.key==="Enter"&&((F=v.current)==null?void 0:F.click())},children:[l.jsx("input",{ref:v,type:"file",accept:".csv",className:Ce.hiddenInput,onChange:D,"aria-hidden":"true"}),s?l.jsxs("div",{className:Ce.fileInfo,children:[l.jsx("span",{className:Ce.fileIcon,children:"📄"}),l.jsx("span",{className:Ce.fileName,children:s.name}),l.jsxs("span",{className:Ce.fileSize,children:["(",(s.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ce.dropHint,children:[l.jsx("span",{className:Ce.dropIcon,children:"⬆️"}),l.jsx("p",{className:Ce.dropText,children:"Drag & drop your CSV here"}),l.jsx("p",{className:Ce.dropSubtext,children:"or click to browse"})]})]}),l.jsx("button",{className:Ce.sampleLink,onClick:x,type:"button",children:"Download Sample CSV"}),c!=="idle"&&l.jsxs("div",{className:`${Ce.statusBar} ${Ce[`status_${c}`]}`,role:"status","aria-live":"polite",children:[c==="processing"&&l.jsx("span",{className:Ce.spinner,"aria-hidden":"true"}),B[c],c==="done"&&b!==null&&l.jsxs("span",{className:Ce.successDetail,children:[" — ",b," item(s) imported"]})]}),d&&l.jsx("p",{className:Ce.errorMsg,role:"alert",children:d}),y.length>0&&l.jsxs("div",{className:Ce.failedSection,children:[l.jsxs("h4",{className:Ce.failedTitle,children:["Failed Rows (",y.length,")"]}),l.jsx("div",{className:Ce.tableWrap,children:l.jsxs("table",{className:Ce.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Row"}),l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Reason"})]})}),l.jsx("tbody",{children:y.map((P,F)=>l.jsxs("tr",{children:[l.jsx("td",{children:P.rowNumber??F+1}),l.jsx("td",{children:P.name??"—"}),l.jsx("td",{className:Ce.reasonCell,children:P.reason??"Unknown error"})]},F))})]})})]})]}),l.jsxs("div",{className:Ce.footer,children:[l.jsx(Ne,{variant:"ghost",onClick:r,disabled:c==="uploading"||c==="processing",children:"Cancel"}),l.jsx(Ne,{variant:"primary",isLoading:c==="uploading"||c==="processing",disabled:!s||c==="done",onClick:A,children:c==="done"?"Uploaded":"Upload"})]})]})},tr={container:"_container_1y30m_1",header:"_header_1y30m_8",headerActions:"_headerActions_1y30m_19",iconBtn:"_iconBtn_1y30m_25",menuWrap:"_menuWrap_1y30m_43",dropdownMenu:"_dropdownMenu_1y30m_47",treeWrapper:"_treeWrapper_1y30m_79",csvModal:"_csvModal_1y30m_95",footer:"_footer_1y30m_105"},p0=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=p.useRef(null),s=p.useRef(null),i=p.useRef(null),[o,a]=p.useState(400),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[y,g]=p.useState("create"),{treeData:b,selectedNodeId:h,selectNode:v,addNode:m,deleteNode:_,reorderChildren:S}=Ie(),w=e==="edit",C=Ee(k=>{var L,$,ee,R;return(($=(L=k.editorConfig)==null?void 0:L.context)==null?void 0:$.contentId)??((R=(ee=k.editorConfig)==null?void 0:ee.context)==null?void 0:R.identifier)??""});p.useEffect(()=>{const k=s.current;if(!k)return;const L=new ResizeObserver(()=>{a(k.clientHeight||400)});return L.observe(k),a(k.clientHeight||400),()=>L.disconnect()},[]),p.useEffect(()=>{if(!c)return;const k=L=>{var $;($=i.current)!=null&&$.contains(L.target)||u(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[c]);const D=p.useCallback(k=>{k.length>0&&v(k[0].data.id)},[v]),x=p.useCallback(({parentId:k,index:L,dragIds:$})=>{if(!k)return;const ee=$[0],R=Af(b,k);if(!(R!=null&&R.children))return;const H=R.children.findIndex(te=>te.id===ee);H<0||S(k,H,L>H?L-1:L)},[b,S]),A=p.useCallback(({ids:k})=>{k.forEach(L=>_(L))},[_]),B=p.useCallback(({parentId:k})=>{var ee;const L=k??((ee=b[0])==null?void 0:ee.id)??"";if(!L)return{id:crypto.randomUUID()};const $=m(L,"unit");return $?{id:$}:(ht.error("Maximum depth reached"),{id:crypto.randomUUID()})},[m,b]),P=p.useCallback(()=>{var L;const k=(L=b[0])==null?void 0:L.id;k&&(m(k,"unit")||ht.error("Maximum depth reached"))},[b,m]),F=p.useCallback(()=>{h&&(m(h,"subunit")||ht.error("Maximum depth reached"))},[h,m]),q=p.useCallback(async()=>{if(u(!1),!!C)try{const k=await kf(C),L=document.createElement("a");L.href=k,L.download=`${C}-folders.csv`,L.target="_blank",document.body.appendChild(L),L.click(),document.body.removeChild(L)}catch{ht.error("Failed to download CSV")}},[C]);return l.jsxs("div",{className:tr.container,children:[l.jsx("div",{className:tr.header,children:l.jsxs("div",{className:tr.headerActions,children:[w&&l.jsxs("div",{className:tr.menuWrap,ref:i,children:[l.jsx("button",{type:"button",className:tr.iconBtn,onClick:()=>u(k=>!k),"aria-label":"More options",title:"More options","aria-haspopup":"true","aria-expanded":c,children:l.jsx(kc,{size:15})}),c&&l.jsxs("div",{className:tr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",onClick:()=>{u(!1),g("create"),f(!0)},children:"Create folders using csv file"}),l.jsx("button",{role:"menuitem",type:"button",onClick:q,children:"Download folders as csv file"}),l.jsx("button",{role:"menuitem",type:"button",onClick:()=>{u(!1),g("update"),f(!0)},children:"Update folder metadata using csv file"})]})]}),r&&l.jsx("button",{type:"button",className:tr.iconBtn,onClick:r,"aria-label":t?"Expand outline":"Collapse outline",title:t?"Expand outline":"Collapse outline",children:t?l.jsx(cv,{size:15}):l.jsx(lv,{size:15})})]})}),l.jsx("div",{className:tr.treeWrapper,ref:s,children:l.jsx(n0,{ref:n,data:b,idAccessor:"id",childrenAccessor:"children",onSelect:D,onMove:w?x:void 0,onDelete:w?A:void 0,onCreate:w?B:void 0,disableEdit:!w,disableDrop:!w,selection:h??void 0,rowHeight:40,indent:20,paddingBottom:16,height:o,width:"100%",children:k=>l.jsx(a0,{...k,editorMode:e})})}),w&&l.jsxs("div",{className:tr.footer,children:[l.jsxs(Ne,{variant:"ghost",size:"sm",onClick:P,children:[l.jsx(cs,{size:14})," Add Unit"]}),l.jsxs(Ne,{variant:"ghost",size:"sm",onClick:F,disabled:!h,children:[l.jsx(Ac,{size:14})," Add Sub-unit"]})]}),d&&l.jsx("div",{className:tr.csvModal,children:l.jsx(h0,{contentId:C,mode:y,onComplete:()=>f(!1),onClose:()=>f(!1)})})]})};function Af(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Af(r.children,t);if(n)return n}}}const Ss={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},g0=({crumbs:e})=>{const t=Ie(r=>r.selectNode);return e.length?l.jsxs("nav",{className:Ss.breadcrumb,"aria-label":"Node path",children:[l.jsx("button",{className:Ss.crumb,onClick:()=>t(e[0].id),"aria-label":"Home",children:l.jsx(sv,{size:13})}),e.map((r,n)=>l.jsxs(p.Fragment,{children:[l.jsx(Nc,{size:13,className:Ss.sep}),n<e.length-1?l.jsx("button",{className:Ss.crumb,onClick:()=>t(r.id),children:r.name}):l.jsx("span",{className:Ss.current,children:r.name})]},r.id))]}):null},Cs={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},Pf=[{id:"details",label:"Details"},{id:"audience",label:"Audience & Curriculum"},{id:"licensing",label:"Licensing"}],y0=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=n?Pf.filter(i=>n.includes(i.id)):Pf;return l.jsx("div",{className:Cs.tabBar,role:"tablist","aria-label":"Metadata sections",children:s.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Cs.tab,e===i.id?Cs.active:"",r.includes(i.id)?Cs.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Cs.errorDot,"aria-label":"Has errors"})]},i.id))})};var Es=e=>e.type==="checkbox",Kr=e=>e instanceof Date,et=e=>e==null;const Mf=e=>typeof e=="object";var xe=e=>!et(e)&&!Array.isArray(e)&&Mf(e)&&!Kr(e),Ha=e=>xe(e)&&e.target?Es(e.target)?e.target.checked:e.target.value:e,Lf=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Ff=e=>{const t=e.constructor&&e.constructor.prototype;return xe(t)&&t.hasOwnProperty("isPrototypeOf")},Hi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Hi&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(xe(e)&&Ff(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Le(e[s]));return n}const Or={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Wt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Kt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},qa="form",$f="root",Bf=["__proto__","constructor","prototype"];var Os=e=>/^\w*$/.test(e),Te=e=>e===void 0,qi=e=>e.split(/[.[\]'"]/g).filter(Boolean),z=(e,t,r)=>{if(!t||!xe(e))return r;const n=Os(t)?[t]:qi(t);if(n.some(i=>Bf.includes(i)))return r;const s=n.reduce((i,o)=>et(i)?void 0:i[o],e);return Te(s)||s===e?Te(e[t])?r:e[t]:s},Tt=e=>typeof e=="boolean",lt=e=>typeof e=="function",Oe=(e,t,r)=>{let n=-1;const s=Os(t)?[t]:qi(t),i=s.length,o=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==o){const u=e[a];c=xe(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Bf.includes(a))return;e[a]=c,e=e[a]}};const Wa=p.createContext(null);Wa.displayName="HookFormControlContext";const Ka=()=>p.useContext(Wa);var jf=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==Wt.all&&(t._proxyFormState[o]=!n||Wt.all),r&&(r[o]=!0),e[o]}});return s};const Ga=Hi?p.useLayoutEffect:p.useEffect;function v0(e){const t=Ka(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[o,a]=p.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ga(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>jf(o,r,c.current,!1),[o,r])}var ct=e=>typeof e=="string",Qa=(e,t,r,n,s)=>ct(e)?(n&&t.watch.add(e),z(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),z(r,i))):(n&&(t.watchAll=!0),r),Ya=e=>et(e)||!Mf(e);const Vf=(e,t)=>t.length===0&&!Array.isArray(e)&&!Ff(e);function It(e,t,r=new WeakMap){if(e===t)return!0;if(Ya(e)||Ya(t))return Object.is(e,t);if(Kr(e)&&Kr(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(Vf(e,n)||Vf(t,s))return Object.is(e,t);const i=r.get(e);if(i&&i.has(t))return!0;i?i.add(t):r.set(e,new WeakSet([t]));for(const o of n){const a=e[o];if(!(o in t))return!1;if(o!=="ref"){const c=t[o];if(Kr(a)&&Kr(c)||(xe(a)||Array.isArray(a))&&(xe(c)||Array.isArray(c))?!It(a,c,r):!Object.is(a,c))return!1}}return!0}function m0(e){const t=Ka(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:o,compute:a}=e||{},c=p.useRef(s),u=p.useRef(a),d=p.useRef(void 0),f=p.useRef(r),y=p.useRef(n);u.current=a;const[g,b]=p.useState(()=>{const w=r._getWatch(n,c.current);return u.current?u.current(w):w}),h=p.useCallback(w=>{const C=Qa(n,r._names,w||r._formValues,!1,c.current);return u.current?u.current(C):C},[r._formValues,r._names,n]),v=p.useCallback(w=>{if(!i){const C=Qa(n,r._names,w||r._formValues,!1,c.current);if(u.current){const D=u.current(C);It(D,d.current)||(b(D),d.current=D)}else b(C)}},[r._formValues,r._names,i,n]);Ga(()=>((f.current!==r||!It(y.current,n))&&(f.current=r,y.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:w=>{v(w.values)}})),[r,o,n,v]),p.useEffect(()=>r._removeUnmounted());const m=f.current!==r,_=y.current,S=p.useMemo(()=>{if(i)return null;const w=!m&&!It(_,n);return m||w?h():null},[i,m,n,_,h]);return S!==null?S:g}function Wi(e){const t=Ka(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:o,exact:a=!0}=e,c=Lf(s._names.array,r),u=p.useMemo(()=>z(s._formValues,r,z(s._defaultValues,r,o)),[s,r,o]),d=m0({control:s,name:r,defaultValue:u,exact:a}),f=v0({control:s,name:r,exact:a}),y=p.useRef(e),g=p.useRef(null),b=p.useRef(s.register(r,{...e.rules,value:d,...Tt(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!z(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!z(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!z(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!z(f.validatingFields,r)},error:{enumerable:!0,get:()=>z(f.errors,r)}}),[f,r]),v=p.useCallback(w=>{const C=Ha(w);return z(s._fields,r)||(b.current=s.register(r,{...y.current.rules,value:C})),b.current.onChange({target:{value:Ha(w),name:r},type:Or.CHANGE})},[r,s]),m=p.useCallback(()=>b.current.onBlur({target:{value:z(s._formValues,r),name:r},type:Or.BLUR}),[r,s._formValues]),_=p.useCallback(w=>{w&&(g.current={focus:()=>lt(w.focus)&&w.focus(),select:()=>lt(w.select)&&w.select(),setCustomValidity:D=>lt(w.setCustomValidity)&&w.setCustomValidity(D),reportValidity:()=>lt(w.reportValidity)&&w.reportValidity()});const C=z(s._fields,r);C&&C._f&&w&&(C._f.ref=g.current)},[s._fields,r]),S=p.useMemo(()=>({name:r,value:d,...Tt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:m,ref:_}),[r,n,f.disabled,v,m,_,d]);return p.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...y.current.rules,...Tt(y.current.disabled)?{disabled:y.current.disabled}:{}});const C=(D,x)=>{const A=z(s._fields,D);A&&A._f&&(A._f.mount=x)};if(C(r,!0),w){const D=Le(z(i?s._defaultValues:s._options.values||s._defaultValues,r,z(s._options.defaultValues,r,y.current.defaultValue)));Oe(s._defaultValues,r,D),Te(z(s._formValues,r))&&Oe(s._formValues,r,D)}if(!c&&s.register(r),g.current){const D=z(s._fields,r);D&&D._f&&(D._f.ref=g.current)}return()=>{(c?w&&!s._state.action:w)?s.unregister(r):C(r,!1)}},[r,s,c,i]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const Ra=p.createContext(null);Ra.displayName="HookFormContext";const Gt=()=>p.useContext(Ra),b0=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:y,unregister:g,control:b,register:h,setFocus:v,subscribe:m})=>{const _=p.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:y,unregister:g,control:b,register:h,setFocus:v,subscribe:m}),[i,b,u,n,r,y,h,f,d,s,v,o,a,m,c,g,t]);return p.createElement(Ra.Provider,{value:_},p.createElement(Wa.Provider,{value:_.control},e))};var _0=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Uf=e=>Array.isArray(e)?e.filter(Boolean):[],Ki=e=>Array.isArray(e)?e:[e],zf=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function Hf(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&xe(s)&&i){const o=Hf(s,i);xe(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var Ge=e=>xe(e)&&!Object.keys(e).length,Xa=e=>e.type==="file",Gi=e=>{if(!Hi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qf=e=>e.type==="select-multiple",Za=e=>e.type==="radio",w0=e=>Za(e)||Es(e),Ja=e=>Gi(e)&&e.isConnected;function S0(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(et(e)){e=void 0;break}e=e[t[n]],n++}return e}function C0(e){for(const t in e)if(e.hasOwnProperty(t)&&!Te(e[t]))return!1;return!0}function ze(e,t){if(ct(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Os(t)?[t]:qi(t),n=r.length===1?e:S0(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(xe(n)&&Ge(n)||Array.isArray(n)&&C0(n))&&ze(e,r.slice(0,-1)),e}var E0=e=>{for(const t in e)if(lt(e[t]))return!0;return!1};function Wf(e){return Array.isArray(e)||xe(e)&&!E0(e)}function el(e,t={}){for(const r in e){const n=e[r];Wf(n)?(t[r]=Array.isArray(n)?[]:{},el(n,t[r])):Te(n)||(t[r]=!0)}return t}function tl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>tl(r));return t.some(r=>r!==void 0)?t:void 0}if(xe(e)){const t={};for(const r in e){const n=tl(e[r]);Te(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Gr(e,t,r){r||(r=el(t));for(const n in e){const s=e[n];if(Wf(s))Te(t)||Ya(r[n])?r[n]=el(s,Array.isArray(s)?[]:{}):Gr(s,et(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!It(s,i)}}return tl(r)||{}}const Kf={value:!1,isValid:!1},Gf={value:!0,isValid:!0};var Qf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Te(e[0].attributes.value)?Te(e[0].value)||e[0].value===""?Gf:{value:e[0].value,isValid:!0}:Gf:Kf}return Kf},Yf=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Te(e)?e:t?e===""?NaN:e&&+e:r&&ct(e)?new Date(e):n?n(e):e;const Rf={isValid:!1,value:null};var Xf=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Rf):Rf;function Zf(e){const t=e.ref;return Xa(t)?t.files:Za(t)?Xf(e.refs).value:qf(t)?[...t.selectedOptions].map(({value:r})=>r):Es(t)?Qf(e.refs).value:Yf(Te(t.value)?e.ref.value:t.value,e)}var O0=(e,t,r,n)=>{const s={};for(const i of e){const o=z(t,i);o&&Oe(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Qi=e=>e instanceof RegExp,Ds=e=>Te(e)?e:Qi(e)?e.source:xe(e)?Qi(e.value)?e.value.source:e.value:e,Jf=e=>({isOnSubmit:!e||e===Wt.onSubmit,isOnBlur:e===Wt.onBlur,isOnChange:e===Wt.onChange,isOnAll:e===Wt.all,isOnTouch:e===Wt.onTouched});const eh="AsyncFunction";var D0=e=>!!e&&!!e.validate&&!!(lt(e.validate)&&e.validate.constructor.name===eh||xe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===eh)),T0=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),rl=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Ts=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=z(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ts(a,t))break}else if(xe(a)&&Ts(a,t))break}}};function th(e,t,r){const n=z(e,r);if(n||Os(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=z(t,i),a=z(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var I0=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Ge(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||Wt.all))},N0=(e,t,r)=>!e||!t||e===t||Ki(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),x0=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,k0=(e,t)=>!Uf(z(e,t)).length&&ze(e,t),rh=(e,t,r)=>{const n=z(e,r),s=Array.isArray(n)?n:[];return Oe(s,$f,t[r]),Oe(e,r,s),e};function nh(e,t,r="validate"){if(ct(e)||Array.isArray(e)&&e.every(ct)||Tt(e)&&!e)return{type:r,message:ct(e)?e:"",ref:t}}var xn=e=>xe(e)&&!Qi(e)?e:{value:e,message:""},sh=async(e,t,r,n,s,i)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:d,min:f,max:y,pattern:g,validate:b,name:h,valueAsNumber:v,mount:m}=e._f,_=z(r,h);if(!m||t.has(h))return{};const S=a?a[0]:o,w=q=>{if(s&&S.reportValidity){const k=Tt(q)?"":q||"";a?a.forEach(L=>L.setCustomValidity(k)):S.setCustomValidity(k),S.reportValidity()}},C={},D=Za(o),x=Es(o),A=D||x,B=(v||Xa(o))&&Te(o.value)&&Te(_)||Gi(o)&&o.value===""||_===""||Array.isArray(_)&&!_.length,P=_0.bind(null,h,n,C),F=(q,k,L,$=Kt.maxLength,ee=Kt.minLength)=>{const R=q?k:L;C[h]={type:q?$:ee,message:R,ref:o,...P(q?$:ee,R)}};if(i?!Array.isArray(_)||!_.length:c&&(!A&&(B||et(_))||Tt(_)&&!_||x&&!Qf(a).isValid||D&&!Xf(a).isValid)){const{value:q,message:k}=ct(c)?{value:!!c,message:c}:xn(c);if(q&&(C[h]={type:Kt.required,message:k,ref:S,...P(Kt.required,k)},!n))return w(k),C}if(!B&&(!et(f)||!et(y))){let q,k;const L=xn(y),$=xn(f);if(!et(_)&&!isNaN(_)){const ee=o.valueAsNumber||_&&+_;et(L.value)||(q=ee>L.value),et($.value)||(k=ee<$.value)}else{const ee=o.valueAsDate||new Date(_),R=ae=>new Date(new Date().toDateString()+" "+ae),H=o.type=="time",te=o.type=="week";ct(L.value)&&_&&(q=H?R(_)>R(L.value):te?_>L.value:ee>new Date(L.value)),ct($.value)&&_&&(k=H?R(_)<R($.value):te?_<$.value:ee<new Date($.value))}if((q||k)&&(F(!!q,L.message,$.message,Kt.max,Kt.min),!n))return w(C[h].message),C}if((u||d)&&!B&&(ct(_)||i&&Array.isArray(_))){const q=xn(u),k=xn(d),L=!et(q.value)&&_.length>+q.value,$=!et(k.value)&&_.length<+k.value;if((L||$)&&(F(L,q.message,k.message),!n))return w(C[h].message),C}if(g&&!B&&ct(_)){const{value:q,message:k}=xn(g);if(Qi(q)&&!_.match(q)&&(C[h]={type:Kt.pattern,message:k,ref:o,...P(Kt.pattern,k)},!n))return w(k),C}if(b){if(lt(b)){const q=await b(_,r),k=nh(q,S);if(k&&(C[h]={...k,...P(Kt.validate,k.message)},!n))return w(k.message),C}else if(xe(b)){let q={};for(const k in b){if(!Ge(q)&&!n)break;const L=nh(await b[k](_,r),S,k);L&&(q={...L,...P(k,L.message)},w(L.message),n&&(C[h]=q))}if(!Ge(q)&&(C[h]={ref:S,...q},!n))return C}}return w(!0),C};const A0={mode:Wt.onSubmit,reValidateMode:Wt.onChange,shouldFocusError:!0},ih={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function P0(e={}){let t={...A0,...e},r={...Le(ih),isLoading:lt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=xe(t.defaultValues)||xe(t.values)?Le(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Le(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let y={...f};const g={array:zf(),state:zf()},b=t.criteriaMode===Wt.all,h=E=>I=>{clearTimeout(u),u=setTimeout(E,I)},v=async E=>{if(!o.keepIsValid&&!t.disabled&&(f.isValid||y.isValid||E)){let I;t.resolver?(I=Ge((await P()).errors),m()):I=await k({fields:n,onlyCheckValid:!0,eventType:Or.VALID}),I!==r.isValid&&g.state.next({isValid:I})}},m=(E,I)=>{!t.disabled&&(f.isValidating||f.validatingFields||y.isValidating||y.validatingFields)&&((E||Array.from(a.mount)).forEach(N=>{N&&(I?Oe(r.validatingFields,N,I):ze(r.validatingFields,N))}),g.state.next({validatingFields:r.validatingFields,isValidating:!Ge(r.validatingFields)}))},_=()=>{r.dirtyFields=Gr(s,i)},S=(E,I=[],N,j,V=!0,K=!0)=>{if(j&&N&&!t.disabled){if(o.action=!0,K&&Array.isArray(z(n,E))){const U=N(z(n,E),j.argA,j.argB);V&&Oe(n,E,U)}if(K&&Array.isArray(z(r.errors,E))){const U=N(z(r.errors,E),j.argA,j.argB);V&&Oe(r.errors,E,U),k0(r.errors,E)}if((f.touchedFields||y.touchedFields)&&K&&Array.isArray(z(r.touchedFields,E))){const U=N(z(r.touchedFields,E),j.argA,j.argB);V&&Oe(r.touchedFields,E,U)}(f.dirtyFields||y.dirtyFields)&&_(),g.state.next({name:E,isDirty:$(E,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Oe(i,E,I)},w=(E,I)=>{Oe(r.errors,E,I),r.errors={...r.errors},g.state.next({errors:r.errors})},C=E=>{r.errors=E,g.state.next({errors:r.errors,isValid:!1})},D=E=>{const I=Os(E)?[E]:qi(E);let N=i,j=s;for(let V=0;V<I.length-1;V++){const K=I[V];if(N=et(N)?N:N[K],j=et(j)?j:j[K],N===null&&j!==null)return!0}return!1},x=(E,I,N,j)=>{const V=z(n,E);if(V){if(D(E))return;const K=Te(z(i,E)),U=z(i,E,Te(N)?z(s,E):N);Te(U)||j&&j.defaultChecked||I?Oe(i,E,I?U:Zf(V._f)):H(E,U),o.mount&&!o.action&&(v(),K&&r.isDirty&&(f.isDirty||y.isDirty)&&($()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&K&&!Te(z(i,E))&&rl(E,a)&&(o.watch=!0))}},A=(E,I,N,j,V)=>{let K=!1,U=!1;const Z={name:E};if(!t.disabled){if(!N||j){(f.isDirty||y.isDirty)&&(U=r.isDirty,r.isDirty=Z.isDirty=$(),K=U!==Z.isDirty);const ce=It(z(s,E),I);U=!!z(r.dirtyFields,E),ce!==r.isDirty?r.dirtyFields=Gr(s,i):ce?ze(r.dirtyFields,E):Oe(r.dirtyFields,E,!0),Z.dirtyFields=r.dirtyFields,K=K||(f.dirtyFields||y.dirtyFields)&&U!==!ce}if(N){const ce=z(r.touchedFields,E);ce||(Oe(r.touchedFields,E,N),Z.touchedFields=r.touchedFields,K=K||(f.touchedFields||y.touchedFields)&&ce!==N)}K&&V&&g.state.next(Z)}return K?Z:{}},B=(E,I,N,j)=>{const V=z(r.errors,E),K=(f.isValid||y.isValid)&&Tt(I)&&r.isValid!==I;if(t.delayError&&N?(c=h(()=>w(E,N)),c(t.delayError)):(clearTimeout(u),c=null,N?Oe(r.errors,E,N):ze(r.errors,E),r.errors={...r.errors}),(N?!It(V,N):V)||!Ge(j)||K){const U={...j,...K&&Tt(I)?{isValid:I}:{},errors:r.errors,name:E};r={...r,...U},g.state.next(U)}},P=async E=>(m(E,!0),await t.resolver(i,t.context,O0(E||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),F=async E=>{const{errors:I}=await P(E);if(m(E),E){for(const N of E){const j=z(I,N);j?a.array.has(N)&&xe(j)&&!Object.keys(j).some(V=>!Number.isNaN(Number(V)))?rh(r.errors,{[N]:j},N):Oe(r.errors,N,j):ze(r.errors,N)}r.errors={...r.errors}}else r.errors=I;return I},q=async({name:E,eventType:I})=>{if(e.validate){const N=await e.validate({formValues:i,formState:r,name:E,eventType:I});if(xe(N))for(const j in N){const V=N[j];V&&We(`${qa}.${j}`,{message:ct(V.message)?V.message:"",type:V.type||Kt.validate})}else ct(N)||!N?We(qa,{message:N||"",type:Kt.validate}):Pe(qa);return N}return!0},k=async({fields:E,onlyCheckValid:I,name:N,eventType:j,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await q({name:N,eventType:j})&&(V.valid=!1,I)))return V.valid;for(const K in E){const U=E[K];if(U){const{_f:Z,...ce}=U;if(Z){const Me=a.array.has(Z.name),Ct=U._f&&D0(U._f),Et=f.validatingFields||f.isValidating||y.validatingFields||y.isValidating;Ct&&Et&&m([Z.name],!0);const pr=await sh(U,a.disabled,i,b,t.shouldUseNativeValidation&&!I,Me);if(Ct&&Et&&m([Z.name]),pr[Z.name]&&(V.valid=!1,I)||(!I&&(z(pr,Z.name)?Me?rh(r.errors,pr,Z.name):Oe(r.errors,Z.name,pr[Z.name]):ze(r.errors,Z.name)),e.shouldUseNativeValidation&&pr[Z.name]))break}!Ge(ce)&&await k({context:V,onlyCheckValid:I,fields:ce,name:K,eventType:j})}}return V.valid},L=()=>{for(const E of a.unMount){const I=z(n,E);I&&(I._f.refs?I._f.refs.every(N=>!Ja(N)):!Ja(I._f.ref))&&kt(E)}a.unMount=new Set},$=(E,I)=>!t.disabled&&(E&&I&&Oe(i,E,I),!It(X(),s)),ee=(E,I,N)=>Qa(E,a,{...o.mount?i:Te(I)?s:ct(E)?{[E]:I}:I},N,I),R=E=>Uf(z(o.mount?i:s,E,t.shouldUnregister?z(s,E,[]):[])),H=(E,I,N={},j=!1)=>{const V=z(n,E);let K=I;if(V){const U=V._f;U&&(!U.disabled&&Oe(i,E,Yf(I,U)),K=Gi(U.ref)&&et(I)?"":I,qf(U.ref)?[...U.ref.options].forEach(Z=>Z.selected=K.includes(Z.value)):U.refs?Es(U.ref)?U.refs.forEach(Z=>{(!Z.defaultChecked||!Z.disabled)&&(Array.isArray(K)?Z.checked=!!K.find(ce=>ce===Z.value):Z.checked=K===Z.value||!!K)}):U.refs.forEach(Z=>Z.checked=Z.value===K):Xa(U.ref)?U.ref.value="":(U.ref.value=K,U.ref.type||g.state.next({name:E,values:j?i:Le(i)})))}(N.shouldDirty||N.shouldTouch)&&A(E,K,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&ue(E)},te=(E,I,N,j=!1)=>{for(const V in I){if(!I.hasOwnProperty(V))return;const K=I[V],U=E+"."+V,Z=z(n,U);(a.array.has(E)||xe(K)||Z&&!Z._f)&&!Kr(K)?te(U,K,N,j):H(U,K,N,j)}},ae=(E,I,N,j)=>{const V=z(n,E),K=a.array.has(E),U=j?I:Le(I),Z=z(i,E),ce=It(Z,U);if(ce||Oe(i,E,U),K)g.array.next({name:E,values:j?i:Le(i)}),(f.isDirty||f.dirtyFields||y.isDirty||y.dirtyFields)&&N.shouldDirty&&(_(),g.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:$(E,U)}));else{const Me=Array.isArray(U)&&!U.length||Ge(U);!V||V._f||et(U)||Me?H(E,U,N,j):te(E,U,N,j)}if(!ce){const Me=rl(E,a),Ct=j?i:Le(i);g.state.next({...Me&&r,name:o.mount||Me?E:void 0,values:Ct})}},W=(E,I,N={})=>ae(E,I,N,!1),J=(E,I={})=>{const N=lt(E)?E(i):E;if(!It(i,N)){i={...i,...N};for(const j of a.mount)ae(j,z(N,j),I,!0);g.state.next({...r,name:void 0,type:void 0,values:i}),I.shouldValidate&&v()}},Y=async E=>{o.mount=!0;const I=E.target;let N=I.name,j=!0;const V=z(n,N),K=ce=>{j=Number.isNaN(ce)||Kr(ce)&&isNaN(ce.getTime())||It(ce,z(i,N,ce))},U=Jf(t.mode),Z=Jf(t.reValidateMode);if(V){let ce,Me;const Ct=I.type?Zf(V._f):Ha(E),Et=E.type===Or.BLUR||E.type===Or.FOCUS_OUT,pr=!T0(V._f)&&!e.validate&&!t.resolver&&!z(r.errors,N)&&!V._f.deps||x0(Et,z(r.touchedFields,N),r.isSubmitted,Z,U),$s=rl(N,a,Et);Oe(i,N,Ct),Et?(!I||!I.readOnly)&&(V._f.onBlur&&V._f.onBlur(E),c&&c(0)):V._f.onChange&&V._f.onChange(E);const an=A(N,Ct,Et),Xe=!Ge(an)||$s;if(!Et&&g.state.next({name:N,type:E.type,values:Le(i)}),pr)return(f.isValid||y.isValid)&&(t.mode==="onBlur"?Et&&v():Et||v()),Xe&&g.state.next({name:N,...$s?{}:an});if(!t.resolver&&e.validate&&await q({name:N,eventType:E.type}),!Et&&$s&&g.state.next({...r}),t.resolver){const{errors:ft}=await P([N]);if(m([N]),K(Ct),!j){!Ge(an)&&g.state.next(an);return}const yt=th(r.errors,n,N),Zt=th(ft,n,yt.name||N);ce=Zt.error,N=Zt.name,Me=Ge(ft)}else m([N],!0),ce=(await sh(V,a.disabled,i,b,t.shouldUseNativeValidation))[N],m([N]),K(Ct),j&&(ce?Me=!1:(f.isValid||y.isValid)&&(Me=await k({fields:n,onlyCheckValid:!0,name:N,eventType:E.type})));j&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&ue(V._f.deps),B(N,Me,ce,an))}},se=(E,I)=>{if(z(r.errors,I)&&E.focus)return E.focus(),1},ue=async(E,I={})=>{let N,j;const V=Ki(E);if(t.resolver){const K=await F(Te(E)?E:V);N=Ge(K),j=E?!V.some(U=>z(K,U)):N}else E?(j=(await Promise.all(V.map(async K=>{const U=z(n,K);return await k({fields:U&&U._f?{[K]:U}:U,eventType:Or.TRIGGER})}))).every(Boolean),!(!j&&!r.isValid)&&v()):j=N=await k({fields:n,name:E,eventType:Or.TRIGGER});return g.state.next({...!ct(E)||(f.isValid||y.isValid)&&N!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:N}:{},errors:r.errors}),I.shouldFocus&&!j&&Ts(n,se,E?V:a.mount),j},X=(E,I)=>{let N={...o.mount?i:s};return I&&(N=Hf(I.dirtyFields?r.dirtyFields:r.touchedFields,N)),Te(E)?N:ct(E)?z(N,E):E.map(j=>z(N,j))},we=(E,I)=>({invalid:!!z((I||r).errors,E),isDirty:!!z((I||r).dirtyFields,E),error:z((I||r).errors,E),isValidating:!!z(r.validatingFields,E),isTouched:!!z((I||r).touchedFields,E)}),Pe=E=>{const I=E?Ki(E):void 0;I==null||I.forEach(N=>ze(r.errors,N)),I?I.forEach(N=>{g.state.next({name:N,errors:r.errors})}):g.state.next({errors:{}})},We=(E,I,N)=>{const j=(z(n,E,{_f:{}})._f||{}).ref,V=z(r.errors,E)||{},{ref:K,message:U,type:Z,...ce}=V;Oe(r.errors,E,{...ce,...I,ref:j}),g.state.next({name:E,errors:r.errors,isValid:!1}),N&&N.shouldFocus&&j&&j.focus&&j.focus()},ve=(E,I)=>lt(E)?g.state.subscribe({next:N=>"values"in N&&E(N.values||ee(void 0,I),N)}):ee(E,I,!0),Xt=E=>g.state.subscribe({next:I=>{if(N0(E.name,I.name,E.exact)&&I0(I,E.formState||f,to,E.reRenderRoot)){const N={...i};E.callback({values:N,...r,...I,defaultValues:s})}}}).unsubscribe,$e=E=>(o.mount=!0,y={...y,...E.formState},Xt({...E,formState:{...d,...E.formState}})),kt=(E,I={})=>{for(const N of E?Ki(E):a.mount)a.mount.delete(N),a.array.delete(N),I.keepValue||(ze(n,N),ze(i,N)),!I.keepError&&ze(r.errors,N),!I.keepDirty&&ze(r.dirtyFields,N),!I.keepTouched&&ze(r.touchedFields,N),!I.keepIsValidating&&ze(r.validatingFields,N),!t.shouldUnregister&&!I.keepDefaultValue&&ze(s,N);g.state.next({values:Le(i)}),g.state.next({...r,...I.keepDirty?{isDirty:$()}:{}}),!I.keepIsValid&&v()},dt=({disabled:E,name:I})=>{if(Tt(E)&&o.mount||E||a.disabled.has(I)){const V=a.disabled.has(I)!==!!E;E?a.disabled.add(I):a.disabled.delete(I),V&&o.mount&&!o.action&&v()}},He=(E,I={})=>{let N=z(n,E);const j=Tt(I.disabled)||Tt(t.disabled),V=!a.registerName.has(E)&&N&&N._f&&!N._f.mount;return Oe(n,E,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:E}},name:E,mount:!0,...I}}),a.mount.add(E),N&&!V?dt({disabled:Tt(I.disabled)?I.disabled:t.disabled,name:E}):x(E,!0,I.value),{...j?{disabled:I.disabled||t.disabled}:{},...t.progressive?{required:!!I.required,min:Ds(I.min),max:Ds(I.max),minLength:Ds(I.minLength),maxLength:Ds(I.maxLength),pattern:Ds(I.pattern)}:{},name:E,onChange:Y,onBlur:Y,ref:K=>{if(K){a.registerName.add(E),He(E,I),a.registerName.delete(E),N=z(n,E);const U=Te(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,Z=w0(U),ce=N._f.refs||[];if(Z?ce.find(Me=>Me===U):U===N._f.ref)return;Oe(n,E,{_f:{...N._f,...Z?{refs:[...ce.filter(Ja),U,...Array.isArray(z(s,E))?[{}]:[]],ref:{type:U.type,name:E}}:{ref:U}}}),x(E,!1,void 0,U)}else N=z(n,E,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||I.shouldUnregister)&&!(Lf(a.array,E)&&o.action)&&a.unMount.add(E)}}},re=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Ts(n,se,a.mount),Re=E=>{Tt(E)&&(g.state.next({disabled:E}),Ts(n,(I,N)=>{const j=z(n,N);j&&(I.disabled=j._f.disabled||E,Array.isArray(j._f.refs)&&j._f.refs.forEach(V=>{V.disabled=j._f.disabled||E}))},0,!1))},wt=(E,I)=>async N=>{let j;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let V=Le(i);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:K,values:U}=await P();m(),r.errors=K,V=Le(U)}else await k({fields:n,eventType:Or.SUBMIT});if(a.disabled.size)for(const K of a.disabled)ze(V,K);if(ze(r.errors,$f),Ge(r.errors)){g.state.next({errors:{}});try{await E(V,N)}catch(K){j=K}}else I&&await I({...r.errors},N),re(),setTimeout(re);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ge(r.errors)&&!j,submitCount:r.submitCount+1,errors:r.errors}),j)throw j},At=(E,I={})=>{z(n,E)&&(Te(I.defaultValue)?W(E,Le(z(s,E))):(W(E,I.defaultValue),Oe(s,E,Le(I.defaultValue))),I.keepTouched||ze(r.touchedFields,E),I.keepDirty||(ze(r.dirtyFields,E),r.isDirty=I.defaultValue?$(E,Le(z(s,E))):$()),I.keepError||(ze(r.errors,E),f.isValid&&v()),g.state.next({...r}))},St=(E,I={})=>{const N=E?Le(E):s,j=Le(N),V=Ge(E),K=j;if(I.keepDefaultValues||(s=N),!I.keepValues){if(I.keepDirtyValues){const U=new Set([...a.mount,...Object.keys(Gr(s,i))]);for(const Z of Array.from(U)){const ce=z(r.dirtyFields,Z),Me=z(i,Z),Ct=z(K,Z);ce&&!Te(Me)?Oe(K,Z,Me):!ce&&!Te(Ct)&&W(Z,Ct)}}else{if(Hi&&Te(E))for(const U of a.mount){const Z=z(n,U);if(Z&&Z._f){const ce=Array.isArray(Z._f.refs)?Z._f.refs[0]:Z._f.ref;if(Gi(ce)){const Me=ce.closest("form");if(Me){Me.reset();break}}}}if(I.keepFieldsRef)for(const U of a.mount)W(U,z(K,U));else n={}}if(t.shouldUnregister){if(i=I.keepDefaultValues?Le(s):{},I.keepFieldsRef)for(const U of a.mount)Oe(i,U,z(K,U))}else i=Le(K);g.array.next({values:{...K}}),g.state.next({values:{...K}})}a={mount:I.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!I.keepIsValid||!!I.keepDirtyValues||!t.shouldUnregister&&!Ge(K),o.watch=!!t.shouldUnregister,o.keepIsValid=!!I.keepIsValid,o.action=!1,I.keepErrors||(r.errors={}),g.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:V?!1:I.keepDirty?r.isDirty:I.keepValues?$():!!(I.keepDefaultValues&&!It(E,s)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:I.keepDirtyValues?I.keepDefaultValues&&i?Gr(s,i):r.dirtyFields:I.keepDefaultValues&&E?Gr(s,E):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},hr=(E,I)=>St(lt(E)?E(i):E,{...t.resetOptions,...I}),Vt=(E,I={})=>{const N=z(n,E),j=N&&N._f;if(j){const V=j.refs?j.refs[0]:j.ref;V.focus&&setTimeout(()=>{V.focus(),I.shouldSelect&<(V.select)&&V.select()})}},to=E=>{r={...r,...E}},ro={control:{register:He,unregister:kt,getFieldState:we,handleSubmit:wt,setError:We,_subscribe:Xt,_runSchema:P,_updateIsValidating:m,_focusError:re,_getWatch:ee,_getDirty:$,_setValid:v,_setFieldArray:S,_setDisabledField:dt,_setErrors:C,_getFieldArray:R,_reset:St,_resetDefaultValues:()=>lt(t.defaultValues)&&t.defaultValues().then(E=>{hr(E,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Re,_subjects:g,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(E){o=E},get _defaultValues(){return s},get _names(){return a},set _names(E){a=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:$e,trigger:ue,register:He,handleSubmit:wt,watch:ve,setValue:W,setValues:J,getValues:X,reset:hr,resetField:At,resetDefaultValues:(E,I={})=>{if(s=Le(E),!I.keepDirty){const N=Gr(s,i);r.dirtyFields=N,r.isDirty=!Ge(N)}I.keepIsValid||v(),g.state.next({...r,defaultValues:s})},clearErrors:Pe,unregister:kt,setError:We,setFocus:Vt,getFieldState:we};return{...ro,formControl:ro}}function M0(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),n=p.useRef(e.formControl),[s,i]=p.useState(()=>({...Le(ih),isLoading:lt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:lt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!lt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=P0(e);t.current={...c,formState:s}}const o=t.current.control;return o._options=e,Ga(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),p.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),p.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),p.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),p.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==s.isDirty&&o._subjects.state.next({isDirty:a})}},[o,s.isDirty]),p.useEffect(()=>{var a;e.values&&!It(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),r.current=e.values,i(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),p.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=p.useMemo(()=>jf(s,o),[o,s]),t.current}async function oh(e){var r,n;return(n=(r=(await Ue.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}function ah(e,t){const r=Ml({queryKey:["framework",e],queryFn:()=>oh(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=Ml({queryKey:["framework",n],queryFn:()=>oh(n),enabled:!!n,staleTime:5*60*1e3}),i=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:i,isLoading:r.isLoading||s.isLoading}}const L0={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."}},lh={"First Section":"details","Second Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing"},F0={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},ch={board:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},uh=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function $0(e,t,r,n){return e!=null&&e.length?e.filter(s=>!(n&&(s.code==="dialCode"||s.code==="dialcode")||s.visible===!1)).map(s=>{const i=s.code??"",o=U0(s),a=z0(s,r,t),c=t[i],u=dh(c,o);return{code:i,label:s.label??i,inputType:o,required:!!(s.required??s.validations),editable:s.editable!==!1,placeholder:s.placeholder,maxLength:s.maxLength,options:j0(a,u,o,r),depends:s.depends,tab:V0(s),section:s.section,defaultValue:s.defaultValue??s.default,currentValue:u}}):W0(t,n,r)}function B0(e){var n,s,i;const t=new Map,r=o=>o==null?void 0:o.forEach(a=>{a.identifier&&t.set(a.identifier,a.name),a.name&&t.set(a.name,a.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(o=>r(o.terms)),(i=e.targetFrameworks)==null||i.forEach(o=>{var a;return(a=o.categories)==null?void 0:a.forEach(c=>r(c.terms))}),t}function j0(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const i=e?[...e]:[],o=new Set(i.map(c=>c.value)),a=B0(n);for(const c of s){const u=String(c);o.has(u)||(i.push({label:a.get(u)??u,value:u}),o.add(u))}return i}function V0(e){const t=e.section;if(t&&lh[t])return lh[t];const r=e.code??"";return F0[r]??"details"}function dh(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function U0(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"||t==="framework"?"select":t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function z0(e,t,r){const n=e.range;if(Array.isArray(n)&&n.length)return typeof n[0]=="string"?n.map(a=>({label:a,value:a})):n.map(a=>({label:a.name,value:a.identifier}));const s=e.enum;if(s!=null&&s.length)return s.map(a=>({label:a,value:a}));const i=e.code??"",o=e.sourceCategory??ch[i];if(o)return fh(i,o,e,t,r)}function fh(e,t,r,n,s){var f,y,g,b,h;const i=uh.has(e)||r.output==="identifier"||typeof r.section=="string"&&r.section.includes("Target"),o=v=>({label:v.name,value:i?v.identifier:v.name}),a=(y=(f=n.organisationFramework)==null?void 0:f.categories)==null?void 0:y.find(v=>v.code===t),c=(h=(b=(g=n.targetFrameworks)==null?void 0:g[0])==null?void 0:b.categories)==null?void 0:h.find(v=>v.code===t);let u=(uh.has(e)?c==null?void 0:c.terms:a==null?void 0:a.terms)??(c==null?void 0:c.terms)??(a==null?void 0:a.terms)??[];const d=r.depends;if(d!=null&&d.length){const v=d.flatMap(m=>{const _=s[m];return Array.isArray(_)?_:_!=null&&_!==""?[_]:[]}).map(String);if(v.length){const m=u.filter(_=>{const S=_.associations;return!S||!S.length?!0:S.some(w=>v.includes(w.identifier)||v.includes(w.code)||v.includes(w.name))});m.length&&(u=m)}}return u.map(o)}function kn(e,t){const r=ch[e];if(r)return fh(e,r,{},t,{})}const H0=[{label:"Student",value:"Student"},{label:"Teacher",value:"Teacher"},{label:"Administrator",value:"Administrator"},{label:"Parent",value:"Parent"},{label:"Other",value:"Other"}],q0=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-NC-ND 4.0",value:"CC BY-NC-ND 4.0"},{label:"CC0 1.0",value:"CC0 1.0"},{label:"All Rights Reserved",value:"All Rights Reserved"}];function tt(e,t,r){return dh(e[t],r)}function W0(e,t,r){const n=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:tt(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:tt(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:tt(e,"keywords","chips")}];return t&&(n.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:tt(e,"primaryCategory","select"),options:[{label:"Course",value:"Course"},{label:"Digital Textbook",value:"Digital Textbook"},{label:"Teacher Resource",value:"Teacher Resource"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"}]},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:tt(e,"additionalCategories","multiselect"),options:[{label:"Lesson Plan",value:"Lesson Plan"},{label:"Textbook",value:"Textbook"},{label:"TV Lesson",value:"TV Lesson"},{label:"Revision Material",value:"Revision Material"}]},{code:"board",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:kn("board",r),currentValue:tt(e,"board","select")},{code:"subject",label:"Subjects covered in the course",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:kn("subject",r),currentValue:tt(e,"subject","multiselect")}),n.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",options:H0,currentValue:tt(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:kn("targetBoardIds",r),currentValue:tt(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:kn("targetMediumIds",r),currentValue:tt(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:kn("targetGradeLevelIds",r),currentValue:tt(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:kn("targetSubjectIds",r),currentValue:tt(e,"targetSubjectIds","multiselect")}),n.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:tt(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:tt(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:tt(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:tt(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",options:q0,currentValue:tt(e,"license","select")})),n}function K0(e,t){const{watch:r,setValue:n}=e;p.useEffect(()=>{const s=r((i,{name:o})=>{o&&t.forEach(a=>{var c;(c=a.depends)!=null&&c.includes(o)&&n(a.code,a.inputType==="multiselect"||a.inputType==="chips"?[]:"",{shouldDirty:!0})})});return()=>s.unsubscribe()},[r,n,t])}const An={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},G0=({title:e,description:t,children:r})=>l.jsxs("div",{className:An.section,children:[l.jsxs("div",{className:An.header,children:[l.jsx("h3",{className:An.title,children:e}),t&&l.jsx("p",{className:An.description,children:t})]}),l.jsx("hr",{className:An.divider}),l.jsx("div",{className:An.fields,children:r})]}),M={field:"_field_hrhbs_1",fullWidth:"_fullWidth_hrhbs_7",label:"_label_hrhbs_11",required:"_required_hrhbs_19",input:"_input_hrhbs_24",textarea:"_textarea_hrhbs_45",inputError:"_inputError_hrhbs_50",error:"_error_hrhbs_54",selectBtn:"_selectBtn_hrhbs_59",selectOpen:"_selectOpen_hrhbs_83",placeholder:"_placeholder_hrhbs_87",selectedVal:"_selectedVal_hrhbs_91",chevronUp:"_chevronUp_hrhbs_95",dropdown:"_dropdown_hrhbs_100",option:"_option_hrhbs_116",optionSelected:"_optionSelected_hrhbs_134",noOpts:"_noOpts_hrhbs_139",chipGroup:"_chipGroup_hrhbs_146",chipInput:"_chipInput_hrhbs_158",addChipBtn:"_addChipBtn_hrhbs_167",radioGroup:"_radioGroup_hrhbs_184",radioLabel:"_radioLabel_hrhbs_191",iconWrap:"_iconWrap_hrhbs_199",iconPreview:"_iconPreview_hrhbs_214",iconPlaceholder:"_iconPlaceholder_hrhbs_220",removeIconBtn:"_removeIconBtn_hrhbs_233",tagChip:"_tagChip_hrhbs_252",tagChipRemove:"_tagChipRemove_hrhbs_264",nestedSelectRow:"_nestedSelectRow_hrhbs_278",dialcodeRow:"_dialcodeRow_hrhbs_287",validateBtn:"_validateBtn_hrhbs_293",dialcodeValid:"_dialcodeValid_hrhbs_315",dialcodeSpinner:"_dialcodeSpinner_hrhbs_325"},hh=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:i,placeholder:o})=>{const{register:a,formState:{errors:c}}=Gt(),u=c[e],d={required:r?`${t} is required`:!1,maxLength:i?{value:i,message:`Max ${i} characters`}:void 0};return l.jsxs("div",{className:[M.field,s?M.fullWidth:""].join(" "),children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[M.input,M.textarea,u?M.inputError:""].join(" "),disabled:n,placeholder:o,rows:3,...a(e,d)}):l.jsx("input",{id:e,type:"text",className:[M.input,u?M.inputError:""].join(" "),disabled:n,placeholder:o,...a(e,d)}),u&&l.jsx("span",{className:M.error,children:String(u.message)})]})},Q0=({name:e,label:t,options:r,required:n,disabled:s})=>{var h;const[i,o]=p.useState(!1),a=p.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=Gt(),y=u(e),g=((h=r.find(v=>v.value===y))==null?void 0:h.label)??"Select…",b=f[e];return p.useEffect(()=>{if(!i)return;const v=m=>{var _;(_=a.current)!=null&&_.contains(m.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),l.jsxs("div",{className:M.field,ref:a,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:n?`${t} is required`:!1})}),l.jsxs("button",{type:"button",disabled:s,className:[M.selectBtn,b?M.inputError:"",i?M.selectOpen:""].join(" "),onClick:()=>o(v=>!v),children:[l.jsx("span",{className:y?M.selectedVal:M.placeholder,children:g}),l.jsx(ls,{size:14,className:i?M.chevronUp:""})]}),i&&l.jsxs("div",{className:M.dropdown,children:[r.map(v=>l.jsxs("button",{type:"button",className:[M.option,y===v.value?M.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),o(!1)},children:[l.jsx("span",{children:v.label}),y===v.value&&l.jsx(fn,{size:13})]},v.value)),!r.length&&l.jsx("span",{className:M.noOpts,children:"No options"})]}),b&&l.jsx("span",{className:M.error,children:String(b.message)})]})},Y0=({name:e,label:t,options:r,required:n,disabled:s})=>{const[i,o]=p.useState(!1),a=p.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=Gt(),y=u(e)??[],g=f[e],b=y.length?`${y.length} selected`:"Select…";p.useEffect(()=>{if(!i)return;const v=m=>{var _;(_=a.current)!=null&&_.contains(m.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]);const h=v=>{const m=y.includes(v)?y.filter(_=>_!==v):[...y,v];d(e,m,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:M.field,ref:a,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:n?`${t} is required`:!1})}),l.jsxs("button",{type:"button",disabled:s,className:[M.selectBtn,g?M.inputError:"",i?M.selectOpen:""].join(" "),onClick:()=>o(v=>!v),children:[l.jsx("span",{className:y.length?M.selectedVal:M.placeholder,children:b}),l.jsx(ls,{size:14,className:i?M.chevronUp:""})]}),i&&l.jsxs("div",{className:M.dropdown,children:[r.map(v=>l.jsxs("button",{type:"button",className:[M.option,y.includes(v.value)?M.optionSelected:""].join(" "),onClick:()=>h(v.value),children:[l.jsx(fn,{size:13,style:{opacity:y.includes(v.value)?1:0}}),l.jsx("span",{children:v.label})]},v.value)),!r.length&&l.jsx("span",{className:M.noOpts,children:"No options"})]}),g&&l.jsx("span",{className:M.error,children:String(g.message)})]})},R0=({name:e,label:t,required:r,disabled:n,placeholder:s="Add…"})=>{const[i,o]=p.useState(""),[a,c]=p.useState(!1),u=p.useRef(null),{watch:d,setValue:f,formState:{errors:y}}=Gt(),g=d(e)??[],b=y[e],h=()=>{const m=i.trim();m&&!g.includes(m)&&f(e,[...g,m],{shouldDirty:!0}),o(""),c(!1)},v=m=>f(e,g.filter(_=>_!==m),{shouldDirty:!0});return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:M.chipGroup,children:[g.map(m=>l.jsxs("span",{className:"sbx-chip filled",children:[m,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>v(m),"aria-label":`Remove ${m}`,children:"×"})]},m)),!n&&(a?l.jsx("input",{ref:u,autoFocus:!0,className:M.chipInput,value:i,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),h()),m.key==="Escape"&&(o(""),c(!1))},onBlur:h,placeholder:s}):l.jsxs("button",{type:"button",className:M.addChipBtn,onClick:()=>{c(!0),setTimeout(()=>{var m;return(m=u.current)==null?void 0:m.focus()},50)},children:[l.jsx(cs,{size:12})," Add"]}))]}),b&&l.jsx("span",{className:M.error,children:String(b.message)})]})},X0=({name:e,label:t,options:r,required:n,disabled:s})=>{const{register:i,formState:{errors:o}}=Gt(),a=o[e];return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("div",{className:M.radioGroup,children:r.map(c=>l.jsxs("label",{className:M.radioLabel,children:[l.jsx("input",{type:"radio",value:c.value,disabled:s,...i(e,{required:n?`${t} is required`:!1})}),c.label]},c.value))}),a&&l.jsx("span",{className:M.error,children:String(a.message)})]})},le={overlay:"_overlay_1o29p_1",modal:"_modal_1o29p_12",header:"_header_1o29p_24",title:"_title_1o29p_33",closeBtn:"_closeBtn_1o29p_39",tabs:"_tabs_1o29p_57",tab:"_tab_1o29p_57",activeTab:"_activeTab_1o29p_83",body:"_body_1o29p_88",searchWrap:"_searchWrap_1o29p_99",searchIcon:"_searchIcon_1o29p_104",searchInput:"_searchInput_1o29p_113",grid:"_grid_1o29p_132",imgCell:"_imgCell_1o29p_148",imgCellSelected:"_imgCellSelected_1o29p_166",thumb:"_thumb_1o29p_171",noThumb:"_noThumb_1o29p_177",checkBadge:"_checkBadge_1o29p_183",loadMoreBtn:"_loadMoreBtn_1o29p_198",loadingRow:"_loadingRow_1o29p_220",empty:"_empty_1o29p_230",spinner:"_spinner_1o29p_237",uploadArea:"_uploadArea_1o29p_247",dropZone:"_dropZone_1o29p_256",uploadIcon:"_uploadIcon_1o29p_277",dropText:"_dropText_1o29p_281",dropSubtext:"_dropSubtext_1o29p_288",uploadPreview:"_uploadPreview_1o29p_294",hiddenInput:"_hiddenInput_1o29p_301",fileName:"_fileName_1o29p_305",errorText:"_errorText_1o29p_311",footer:"_footer_1o29p_318",cancelBtn:"_cancelBtn_1o29p_328",confirmBtn:"_confirmBtn_1o29p_345"},ph=18,gh=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const[s,i]=p.useState("my"),[o,a]=p.useState(""),[c,u]=p.useState([]),[d,f]=p.useState(0),[y,g]=p.useState(!1),[b,h]=p.useState(null),[v,m]=p.useState(0),[_,S]=p.useState(null),[w,C]=p.useState(""),[D,x]=p.useState(!1),[A,B]=p.useState(""),P=p.useRef(null),F=Ee(W=>{var J,Y;return((Y=(J=W.editorConfig)==null?void 0:J.context)==null?void 0:Y.channel)??""}),q=Ee(W=>{var J,Y;return((Y=(J=W.editorConfig)==null?void 0:J.context)==null?void 0:Y.uid)??""}),k=p.useCallback(async(W,J,Y=!1)=>{var se;g(!0);try{const ue={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};s==="my"&&q&&(ue.createdBy=q),F&&(ue.channel=F);const we=((se=(await Ue.post("/action/composite/v3/search",{request:{filters:ue,query:W,limit:ph,offset:J,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:se.result)??{},Pe=we.content??[];f(we.count??0),u(We=>Y?[...We,...Pe]:Pe)}catch{}finally{g(!1)}},[s,q,F]);p.useEffect(()=>{s!=="upload"&&(u([]),m(0),k(o,0))},[s]);const L=p.useRef(),$=W=>{a(W),clearTimeout(L.current),L.current=setTimeout(()=>{u([]),m(0),k(W,0)},400)},ee=()=>{const W=v+ph;m(W),k(o,W,!0)},R=()=>{const W=(b==null?void 0:b.artifactUrl)??(b==null?void 0:b.appIcon)??(b==null?void 0:b.downloadUrl)??"";W&&r(W)},H=W=>{var Y;const J=(Y=W.target.files)==null?void 0:Y[0];if(W.target.value="",!!J){if(!J.type.startsWith("image/")){B("Only image files are accepted.");return}if(J.size>4*1024*1024){B("Image must be under 4 MB.");return}S(J),C(URL.createObjectURL(J)),B("")}},te=async()=>{var W,J;if(_){x(!0),B("");try{const Y=new FormData;Y.append("file",_);const ue=(J=(W=(await Ue.post(`/action/content/v3/upload/${e}?fileType=image`,Y,{headers:{"Content-Type":"multipart/form-data"}})).data)==null?void 0:W.result)==null?void 0:J.artifactUrl;if(!ue)throw new Error("No URL in response");r(ue)}catch(Y){B(Y instanceof Error?Y.message:"Upload failed.")}finally{x(!1)}}},ae=c.length<d;return l.jsx("div",{className:le.overlay,role:"dialog","aria-modal":"true","aria-label":"Select App Icon",children:l.jsxs("div",{className:le.modal,children:[l.jsxs("div",{className:le.header,children:[l.jsx("span",{className:le.title,children:"Select App Icon"}),l.jsx("button",{className:le.closeBtn,onClick:n,"aria-label":"Close",children:l.jsx(Br,{size:18})})]}),l.jsxs("div",{className:le.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":s==="my",className:`${le.tab} ${s==="my"?le.activeTab:""}`,onClick:()=>i("my"),children:"My Images"}),l.jsx("button",{role:"tab","aria-selected":s==="all",className:`${le.tab} ${s==="all"?le.activeTab:""}`,onClick:()=>i("all"),children:"All Images"}),l.jsxs("button",{role:"tab","aria-selected":s==="upload",className:`${le.tab} ${s==="upload"?le.activeTab:""}`,onClick:()=>i("upload"),children:[l.jsx(Fc,{size:13,style:{marginRight:4}}),"Upload"]})]}),l.jsx("div",{className:le.body,children:s!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:le.searchWrap,children:[l.jsx(Vo,{size:14,className:le.searchIcon}),l.jsx("input",{type:"search",className:le.searchInput,placeholder:"Search images…",value:o,onChange:W=>$(W.target.value)})]}),y&&c.length===0?l.jsxs("div",{className:le.loadingRow,children:[l.jsx(ci,{size:20,className:le.spinner}),l.jsx("span",{children:"Loading…"})]}):c.length===0?l.jsx("div",{className:le.empty,children:"No images found"}):l.jsx("div",{className:le.grid,children:c.map(W=>{const J=W.appIcon??W.artifactUrl??W.downloadUrl??"",Y=(b==null?void 0:b.identifier)===W.identifier;return l.jsxs("button",{type:"button",className:`${le.imgCell} ${Y?le.imgCellSelected:""}`,onClick:()=>h(W),title:W.name,children:[J?l.jsx("img",{src:J,alt:W.name,className:le.thumb}):l.jsx("div",{className:le.noThumb,children:"IMG"}),Y&&l.jsx("div",{className:le.checkBadge,children:l.jsx(fn,{size:12})})]},W.identifier)})}),ae&&!y&&l.jsx("button",{className:le.loadMoreBtn,onClick:ee,children:"Load More"}),y&&c.length>0&&l.jsx("div",{className:le.loadingRow,children:l.jsx(ci,{size:16,className:le.spinner})})]}):l.jsxs("div",{className:le.uploadArea,children:[l.jsx("div",{className:le.dropZone,onClick:()=>{var W;return(W=P.current)==null?void 0:W.click()},onDragOver:W=>W.preventDefault(),onDrop:W=>{W.preventDefault();const J=W.dataTransfer.files[0];J&&H({target:{files:[J],value:""}})},children:w?l.jsx("img",{src:w,alt:"Preview",className:le.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(Fc,{size:32,className:le.uploadIcon}),l.jsx("p",{className:le.dropText,children:"Drag & drop or click to browse"}),l.jsx("p",{className:le.dropSubtext,children:"PNG, JPG, SVG · max 4 MB"})]})}),l.jsx("input",{ref:P,type:"file",accept:"image/*",className:le.hiddenInput,onChange:H}),_&&l.jsx("p",{className:le.fileName,children:_.name}),A&&l.jsx("p",{className:le.errorText,children:A})]})}),l.jsxs("div",{className:le.footer,children:[l.jsx("button",{className:le.cancelBtn,onClick:n,children:"Cancel"}),s==="upload"?l.jsx("button",{className:le.confirmBtn,disabled:!_||D,onClick:te,children:D?l.jsxs(l.Fragment,{children:[l.jsx(ci,{size:14,className:le.spinner})," Uploading…"]}):"Upload & Use"}):l.jsx("button",{className:le.confirmBtn,disabled:!b,onClick:R,children:"Use Selected"})]})]})})},Z0=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const[i,o]=p.useState(!1),{watch:a,setValue:c,register:u,formState:{errors:d}}=Gt(),f=a(e),y=d[e],g=h=>{c(e,h,{shouldDirty:!0,shouldValidate:!0}),o(!1)},b=()=>{c(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?`${t} is required`:!1})}),l.jsx("div",{className:M.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":"Select app icon",onClick:()=>!s&&o(!0),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&!s&&o(!0)},children:f?l.jsx("img",{src:f,alt:"App icon",className:M.iconPreview}):l.jsxs("div",{className:M.iconPlaceholder,children:[l.jsx(Mc,{size:20}),l.jsx("span",{children:"Select icon"})]})}),f&&!s&&l.jsxs("button",{type:"button",className:M.removeIconBtn,onClick:b,"aria-label":"Remove app icon",children:[l.jsx(Uo,{size:13}),l.jsx("span",{children:"Remove"})]}),y&&l.jsx("span",{className:M.error,children:String(y.message)}),i&&l.jsx(gh,{nodeId:r,currentValue:f,onSelect:g,onClose:()=>o(!1)})]})},J0=({name:e,label:t,required:r,disabled:n})=>{const{control:s}=Gt(),{field:i,fieldState:{error:o}}=Wi({name:e,control:s,rules:{required:r?`${t} is required`:!1}});return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[M.input,o?M.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:i.onChange,onBlur:i.onBlur,ref:i.ref}),o&&l.jsx("span",{className:M.error,children:String(o.message)})]})},eE=({name:e,label:t,required:r,disabled:n})=>{const{control:s}=Gt(),{field:i,fieldState:{error:o}}=Wi({name:e,control:s,rules:{required:r?`${t} is required`:!1},defaultValue:[]}),[a,c]=p.useState(""),u=p.useRef(null),d=i.value??[],f=h=>{const v=h.trim();!v||d.includes(v)||i.onChange([...d,v])},y=h=>{i.onChange(d.filter(v=>v!==h))},g=h=>{h.key==="Enter"||h.key===","?(h.preventDefault(),f(a),c("")):h.key==="Backspace"&&a===""&&d.length>0&&y(d[d.length-1])},b=()=>{a.trim()&&(f(a),c("")),i.onBlur()};return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:[M.chipGroup,o?M.inputError:""].join(" "),onClick:()=>{var h;return!n&&((h=u.current)==null?void 0:h.focus())},style:{cursor:n?"not-allowed":"text"},children:[d.map(h=>l.jsxs("span",{className:M.tagChip,children:[h,!n&&l.jsx("button",{type:"button",className:M.tagChipRemove,onClick:v=>{v.stopPropagation(),y(h)},"aria-label":`Remove ${h}`,children:l.jsx(Br,{size:11})})]},h)),!n&&l.jsx("input",{ref:u,className:M.chipInput,value:a,onChange:h=>c(h.target.value),onKeyDown:g,onBlur:b,placeholder:d.length===0?"Type and press Enter or comma…":"",style:{flexGrow:1,minWidth:120}})]}),o&&l.jsx("span",{className:M.error,children:String(o.message)})]})},tE=({name:e,label:t,levels:r,required:n,disabled:s})=>{const{control:i}=Gt(),{field:o,fieldState:{error:a}}=Wi({name:e,control:i,rules:{required:n?`${t} is required`:!1},defaultValue:{}}),c=o.value??{},u=(d,f,y)=>{const g={};for(let b=0;b<f;b++)g[r[b].code]=c[r[b].code]??"";g[d]=y;for(let b=f+1;b<r.length;b++)g[r[b].code]="";o.onChange(g)};return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("div",{className:M.nestedSelectRow,children:r.map((d,f)=>{const y=f>0&&!c[r[f-1].code];return l.jsxs("div",{className:M.field,style:{flex:1},children:[l.jsx("label",{className:M.label,htmlFor:`${e}_${d.code}`,children:d.label}),l.jsxs("select",{id:`${e}_${d.code}`,className:[M.input,a?M.inputError:""].join(" "),disabled:s||y,value:c[d.code]??"",onChange:g=>u(d.code,f,g.target.value),onBlur:o.onBlur,children:[l.jsx("option",{value:"",children:"Select…"}),d.options.map(g=>l.jsx("option",{value:g.value,children:g.label},g.value))]})]},d.code)})}),a&&l.jsx("span",{className:M.error,children:String(a.message)})]})},yh=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],rE=({name:e,label:t,required:r,disabled:n})=>{const[s,i]=p.useState(!1),o=p.useRef(null),{register:a,watch:c,setValue:u,formState:{errors:d}}=Gt(),f=c(e),y=yh.find(h=>h.value===f),g=(y==null?void 0:y.label)??"Select license…",b=d[e];return p.useEffect(()=>{if(!s)return;const h=v=>{var m;(m=o.current)!=null&&m.contains(v.target)||i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),l.jsxs("div",{className:M.field,ref:o,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...a(e,{required:r?`${t} is required`:!1})}),l.jsxs("button",{type:"button",disabled:n,className:[M.selectBtn,b?M.inputError:"",s?M.selectOpen:""].join(" "),onClick:()=>i(h=>!h),"aria-haspopup":"listbox","aria-expanded":s,children:[l.jsx("span",{className:f?M.selectedVal:M.placeholder,children:g}),l.jsx(ls,{size:14,className:s?M.chevronUp:""})]}),s&&l.jsx("div",{className:M.dropdown,role:"listbox",children:yh.map(h=>l.jsxs("button",{type:"button",role:"option","aria-selected":f===h.value,className:[M.option,f===h.value?M.optionSelected:""].join(" "),onClick:()=>{u(e,h.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:h.label}),f===h.value&&l.jsx(fn,{size:13})]},h.value))}),b&&l.jsx("span",{className:M.error,children:String(b.message)})]})},nE=({name:e,label:t,required:r,disabled:n})=>{const{control:s}=Gt(),{field:i,fieldState:{error:o}}=Wi({name:e,control:s,rules:{required:r?`${t} is required`:!1},defaultValue:""}),[a,c]=p.useState("idle"),[u,d]=p.useState(""),f=async()=>{const g=(i.value??"").trim();if(!g){c("invalid"),d("Enter a dial code to validate.");return}c("loading"),d("");try{const b=await jb(g),h=b==null?void 0:b.result,v=h==null?void 0:h.dialcodes;Array.isArray(v)&&v.length>0?(c("valid"),d("Dial code is valid.")):(c("invalid"),d("Dial code not found."))}catch{c("invalid"),d("Validation failed. Please try again.")}},y=()=>a==="loading"?l.jsx(ci,{size:16,className:M.dialcodeSpinner}):a==="valid"?l.jsx(xc,{size:16,color:"var(--sbx-success, #2e7d32)"}):a==="invalid"?l.jsx(Lo,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:M.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[M.input,o?M.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:g=>{i.onChange(g),c("idle"),d("")},onBlur:i.onBlur,ref:i.ref,placeholder:"e.g. A1B2C3",style:{flex:1}}),l.jsx("button",{type:"button",className:M.validateBtn,onClick:f,disabled:n||a==="loading","aria-label":"Validate dial code",children:a==="loading"?"Validating…":"Validate"}),y()]}),o&&l.jsx("span",{className:M.error,children:String(o.message)}),!o&&u&&l.jsx("span",{className:a==="valid"?M.dialcodeValid:M.error,children:u})]})},nl={form:"_form_szqex_1",ungrouped:"_ungrouped_szqex_7",noFields:"_noFields_szqex_18"},sE=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:i,onFormStatusChange:o})=>{var $,ee,R;const a=Ee(H=>H.editorConfig),c=Ee(H=>H.rootFormConfig),u=Ee(H=>H.unitFormConfig),{organisationFramework:d,targetFrameworks:f,isLoading:y}=ah(($=a==null?void 0:a.context)==null?void 0:$.framework,(ee=a==null?void 0:a.context)==null?void 0:ee.targetFWIds),g={organisationFramework:d,targetFrameworks:f},b=Ie(H=>H.selectedNodeId),h=Ie(H=>H.treeCache),v=b?h[b]??{}:{},m={...e,...v},_=r?c:u,S=_||(((R=a==null?void 0:a.config.hierarchy)==null?void 0:R.formConfig)??[]),w=$0(S,m,g,r),C=w.filter(H=>H.tab===t&&H.inputType!=="appIcon"),D=M0({mode:"onChange",defaultValues:Object.fromEntries(w.map(H=>{const te=["multiselect","chips","keywords","tagsinput"],ae=["nestedselect"];return te.includes(H.inputType)?[H.code,H.currentValue??H.defaultValue??[]]:ae.includes(H.inputType)?[H.code,H.currentValue??H.defaultValue??{}]:[H.code,H.currentValue??H.defaultValue??""]}))});K0(D,w);const{updateNode:x}=Ie(),A=p.useRef(w);A.current=w;const B=p.useRef(b);B.current=b;const P=p.useRef(i);P.current=i;const F=p.useRef(o);F.current=o,p.useEffect(()=>{const H=D.watch((te,{name:ae})=>{const W=B.current;if(!W)return;const J=A.current,Y=new Set(J.map(X=>X.code));if(ae&&Y.has(ae)){const X=D.getValues(ae);x(W,{[ae]:X}),P.current({[ae]:X})}else if(!ae){const X=D.getValues(),we=Object.fromEntries(Object.entries(X).filter(([Pe])=>Y.has(Pe)));Object.keys(we).length>0&&(x(W,we),P.current(we))}const se=D.formState.errors,ue=Array.from(new Set(Object.keys(se).map(X=>{var we;return(we=J.find(Pe=>Pe.code===X))==null?void 0:we.tab}).filter(Boolean)));F.current(Object.keys(se).length===0,ue)});return()=>H.unsubscribe()},[D]);const q=s!=="edit",k=C.reduce((H,te)=>{const ae=H[H.length-1];return ae&&ae.section===te.section?ae.fields.push(te):H.push({section:te.section,fields:[te]}),H},[]),L=H=>{const te={key:H.code,name:H.code,label:H.label,required:H.required,disabled:q||H.editable===!1};switch(H.inputType){case"textarea":return l.jsx(hh,{...te,multiline:!0,maxLength:H.maxLength});case"select":return l.jsx(Q0,{...te,options:H.options??[]});case"multiselect":return l.jsx(Y0,{...te,options:H.options??[]});case"chips":return l.jsx(R0,{...te});case"radio":return l.jsx(X0,{...te,options:H.options??[]});case"appIcon":return l.jsx(Z0,{...te,nodeId:b??""});case"datepicker":case"datetime":return l.jsx(J0,{...te});case"keywords":case"tagsinput":return l.jsx(eE,{...te});case"nestedselect":return l.jsx(tE,{...te,levels:H.levels??[]});case"license":return l.jsx(rE,{...te});case"dialcode":return l.jsx(nE,{...te});default:return l.jsx(hh,{...te,maxLength:H.maxLength})}};return l.jsx(b0,{...D,children:l.jsxs("div",{className:nl.form,children:[k.map((H,te)=>{const ae=H.section?L0[H.section]:void 0;return ae?l.jsx(G0,{title:ae.title,description:ae.description,children:H.fields.map(L)},H.section??te):l.jsx("div",{className:nl.ungrouped,children:H.fields.map(L)},te)}),C.length===0&&!y&&l.jsx("p",{className:nl.noFields,children:"No fields configured for this tab."})]})})};function vh(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function iE(e,t){return e.reduce((r,n,s)=>{const i=t.get(n);return i&&(r[s]=i),r},Array(e.length))}function Yi(e){return e!==null&&e>=0}function oE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function aE(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const mh=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const i=vh(t,n,r),o=t[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},Ri={scaleX:1,scaleY:1},lE=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:i,overIndex:o}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(s===r){const u=i[o];return u?{x:0,y:r<o?u.top+u.height-(a.top+a.height):u.top-a.top,...Ri}:null}const c=cE(i,s,r);return s>r&&s<=o?{x:0,y:-a.height-c,...Ri}:s<r&&s>=o?{x:0,y:a.height+c,...Ri}:{x:0,y:0,...Ri}};function cE(e,t,r){const n=e[t],s=e[t-1],i=e[t+1];return n?r<t?s?n.top-(s.top+s.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const bh="Sortable",_h=p.createContext({activeIndex:-1,containerId:bh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mh,disabled:{draggable:!1,droppable:!1}});function uE(e){let{children:t,id:r,items:n,strategy:s=mh,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=Dc(),f=ts(bh,r),y=a.rect!==null,g=p.useMemo(()=>n.map(D=>typeof D=="object"&&"id"in D?D.id:D),[n]),b=o!=null,h=o?g.indexOf(o.id):-1,v=u?g.indexOf(u.id):-1,m=p.useRef(g),_=!oE(g,m.current),S=v!==-1&&h===-1||_,w=aE(i);zt(()=>{_&&b&&d(g)},[_,g,b,d]),p.useEffect(()=>{m.current=g},[g]);const C=p.useMemo(()=>({activeIndex:h,containerId:f,disabled:w,disableTransforms:S,items:g,overIndex:v,useDragOverlay:y,sortedRects:iE(g,c),strategy:s}),[h,f,w.draggable,w.droppable,S,g,v,c,y,s]);return p.createElement(_h.Provider,{value:C},t)}const dE=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return vh(r,n,s).indexOf(t)},fE=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!n||a!==i&&s===o?!1:r?!0:o!==s&&t===c},hE={duration:200,easing:"ease"},wh="transform",pE=wr.Transition.toString({property:wh,duration:0,easing:"linear"}),gE={roleDescription:"sortable"};function yE(e){let{disabled:t,index:r,node:n,rect:s}=e;const[i,o]=p.useState(null),a=p.useRef(r);return zt(()=>{if(!t&&r!==a.current&&n.current){const c=s.current;if(c){const u=dn(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}r!==a.current&&(a.current=r)},[t,r,n,s]),p.useEffect(()=>{i&&o(null)},[i]),i}function vE(e){let{animateLayoutChanges:t=fE,attributes:r,disabled:n,data:s,getNewIndex:i=dE,id:o,strategy:a,resizeObserverConfig:c,transition:u=hE}=e;const{items:d,containerId:f,activeIndex:y,disabled:g,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:m,strategy:_}=p.useContext(_h),S=mE(n,g),w=d.indexOf(o),C=p.useMemo(()=>({sortable:{containerId:f,index:w,items:d},...s}),[f,s,w,d]),D=p.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:x,node:A,isOver:B,setNodeRef:P}=$y({id:o,data:C,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...c}}),{active:F,activatorEvent:q,activeNodeRect:k,attributes:L,setNodeRef:$,listeners:ee,isDragging:R,over:H,setActivatorNodeRef:te,transform:ae}=Oc({id:o,data:C,attributes:{...gE,...r},disabled:S.draggable}),W=Sg(P,$),J=!!F,Y=J&&!b&&Yi(y)&&Yi(v),se=!m&&R,ue=se&&Y?ae:null,we=Y?ue??(a??_)({rects:h,activeNodeRect:k,activeIndex:y,overIndex:v,index:w}):null,Pe=Yi(y)&&Yi(v)?i({id:o,items:d,activeIndex:y,overIndex:v}):w,We=F==null?void 0:F.id,ve=p.useRef({activeId:We,items:d,newIndex:Pe,containerId:f}),Xt=d!==ve.current.items,$e=t({active:F,containerId:f,isDragging:R,isSorting:J,id:o,index:w,items:d,newIndex:ve.current.newIndex,previousItems:ve.current.items,previousContainerId:ve.current.containerId,transition:u,wasDragging:ve.current.activeId!=null}),kt=yE({disabled:!$e,index:w,node:A,rect:x});return p.useEffect(()=>{J&&ve.current.newIndex!==Pe&&(ve.current.newIndex=Pe),f!==ve.current.containerId&&(ve.current.containerId=f),d!==ve.current.items&&(ve.current.items=d)},[J,Pe,f,d]),p.useEffect(()=>{if(We===ve.current.activeId)return;if(We&&!ve.current.activeId){ve.current.activeId=We;return}const He=setTimeout(()=>{ve.current.activeId=We},50);return()=>clearTimeout(He)},[We]),{active:F,activeIndex:y,attributes:L,data:C,rect:x,index:w,newIndex:Pe,items:d,isOver:B,isSorting:J,isDragging:R,listeners:ee,node:A,overIndex:v,over:H,setNodeRef:W,setActivatorNodeRef:te,setDroppableNodeRef:P,setDraggableNodeRef:$,transform:kt??we,transition:dt()};function dt(){if(kt||Xt&&ve.current.newIndex===w)return pE;if(!(se&&!ei(q)||!u)&&(J||$e))return wr.Transition.toString({...u,property:wh})}}function mE(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function Xi(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const bE=[ge.Down,ge.Right,ge.Up,ge.Left],_E=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=t;if(bE.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const y=s.get(f.id);if(y)switch(e.code){case ge.Down:n.top<y.top&&c.push(f);break;case ge.Up:n.top>y.top&&c.push(f);break;case ge.Left:n.left>y.left&&c.push(f);break;case ge.Right:n.left<y.left&&c.push(f);break}});const u=jg({collisionRect:n,droppableRects:s,droppableContainers:c});let d=Xl(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=i.get(r.id),y=i.get(d),g=y?s.get(y.id):null,b=y==null?void 0:y.node.current;if(b&&g&&f&&y){const v=ni(b).some((D,x)=>a[x]!==D),m=Sh(f,y),_=wE(f,y),S=v||!m?{x:0,y:0}:{x:_?n.width-g.width:0,y:_?n.height-g.height:0},w={x:g.left,y:g.top};return S.x&&S.y?w:rs(w,S)}}}};function Sh(e,t){return!Xi(e)||!Xi(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function wE(e,t){return!Xi(e)||!Xi(t)||!Sh(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Qr={row:"_row_11nth_1",removeBtn:"_removeBtn_11nth_14",grip:"_grip_11nth_17",ctIcon:"_ctIcon_11nth_34",info:"_info_11nth_38",name:"_name_11nth_46",meta:"_meta_11nth_55"},SE={video:zo,pdf:Fo,h5p:$o,scorm:jo,audio:Bo,quiz:Mo,default:hn},CE=({item:e,onRemove:t,isEditable:r})=>{const n=zi(e),s=SE[n.key]??hn,{attributes:i,listeners:o,setNodeRef:a,transform:c,transition:u,isDragging:d}=vE({id:e.id,disabled:!r}),f={transform:wr.Transform.toString(c),transition:u,opacity:d?.5:1};return l.jsxs("div",{ref:a,style:f,className:Qr.row,role:"listitem",children:[r&&l.jsx("span",{className:Qr.grip,...i,...o,"aria-label":"Drag to reorder",children:l.jsx(Pc,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${n.key}`,Qr.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(s,{size:14})}),l.jsxs("div",{className:Qr.info,children:[l.jsx("span",{className:Qr.name,title:e.name,children:e.name}),l.jsx("span",{className:Qr.meta,children:n.label})]}),l.jsx("span",{className:`sbx-ct-badge--${n.key}`,children:n.label}),r&&l.jsx("button",{type:"button",className:Qr.removeBtn,onClick:()=>t(e.id),"aria-label":`Remove ${e.name}`,children:l.jsx(Br,{size:14})})]})},Yr={container:"_container_lzvke_1",header:"_header_lzvke_7",heading:"_heading_lzvke_13",count:"_count_lzvke_21",list:"_list_lzvke_30",emptyState:"_emptyState_lzvke_36",addRow:"_addRow_lzvke_52"},EE=({editorMode:e})=>{const{selectedNodeId:t,getChildrenOf:r,reorderChildren:n,deleteNode:s}=Ie(),i=t?r(t):[],o=e==="edit",a=Gl(Co(si,{activationConstraint:{distance:5}}),Co(Io,{coordinateGetter:_E})),c=p.useCallback(d=>{const{active:f,over:y}=d;if(!y||f.id===y.id||!t)return;const g=Ie.getState().getChildrenOf(t),b=g.findIndex(v=>v.id===f.id),h=g.findIndex(v=>v.id===y.id);b<0||h<0||n(t,b,h)},[t,n]),u=p.useCallback(d=>{window.confirm("Remove this content from the unit?")&&s(d)},[s]);return t?l.jsxs("div",{className:Yr.container,children:[l.jsxs("div",{className:Yr.header,children:[l.jsx("span",{className:Yr.heading,children:"Content in this unit"}),l.jsx("span",{className:Yr.count,children:i.length})]}),i.length>0?l.jsx(Cc,{sensors:a,collisionDetection:Bg,onDragEnd:c,children:l.jsx(uE,{items:i.map(d=>d.id),strategy:lE,children:l.jsx("div",{className:Yr.list,role:"list",children:i.map(d=>l.jsx(CE,{item:d,onRemove:u,isEditable:o},d.id))})})}):l.jsxs("div",{className:Yr.emptyState,children:[l.jsx("p",{children:"No content yet"}),l.jsx("span",{children:"Drag from the library or click Add content"})]}),o&&l.jsxs("button",{className:Yr.addRow,type:"button","aria-label":"Add content to unit",children:[l.jsx(cs,{size:14})," Add content"]})]}):null},Ch={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},OE=({isActive:e,label:t="Drop here",nodeId:r,className:n})=>l.jsx("div",{className:`${Ch.dropZone} ${e?Ch.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":t,role:"region",children:l.jsx("span",{children:t})}),ke={contentPlayerRoot:"_contentPlayerRoot_gf3xd_1",stage:"_stage_gf3xd_9",playerHeader:"_playerHeader_gf3xd_19",playerHeaderThumb:"_playerHeaderThumb_gf3xd_33",playerHeaderTitle:"_playerHeaderTitle_gf3xd_43",typeBadge:"_typeBadge_gf3xd_53",typeDot:"_typeDot_gf3xd_92",aspectRatio:"_aspectRatio_gf3xd_99",playerFrame:"_playerFrame_gf3xd_112",coverOverlay:"_coverOverlay_gf3xd_120",coverHidden:"_coverHidden_gf3xd_132",coverThumb:"_coverThumb_gf3xd_137",coverPlayRing:"_coverPlayRing_gf3xd_146",coverPlayIcon:"_coverPlayIcon_gf3xd_159",coverLabel:"_coverLabel_gf3xd_168",coverSkeleton:"_coverSkeleton_gf3xd_174",playerWrapper:"_playerWrapper_gf3xd_200",infoStrip:"_infoStrip_gf3xd_210",infoChip:"_infoChip_gf3xd_226",infoChipLabel:"_infoChipLabel_gf3xd_245",infoChipIcon:"_infoChipIcon_gf3xd_254",qumlRoot:"_qumlRoot_gf3xd_260"},DE=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"],label:"Video",icon:"🎬"},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"],label:"Audio",icon:"🎵"},{key:"pdf",mimes:["application/pdf"],label:"PDF",icon:"📄"},{key:"epub",mimes:["application/epub"],label:"ePub",icon:"📖"},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"],label:"ECML",icon:"✏️"},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"],label:"H5P",icon:"🎮"},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"],label:"SCORM",icon:"📦"}];function TE(e){return DE.find(t=>t.mimes.includes(e))??{key:"other",label:"Content",icon:"📱"}}const IE={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},NE={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},xE={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},kE="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Eh(e){for(const[t,r]of Object.entries(IE))if(r.includes(e))return t;return"default-player"}function AE(e,t){var i;const r=t==null?void 0:t.context,n=e.metadata??{},s=e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((i=r==null?void 0:r.pdata)==null?void 0:i.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(r==null?void 0:r.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1,previewCdnUrl:void 0},metadata:n,data:s==="application/vnd.ekstep.ecml-archive"?n.body??{}:{}}}function PE(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}function ME(e,t,r=100){return PE(NE[t]??"").then(()=>new Promise(n=>{if(customElements.get(e)){n();return}let s=0;const i=setInterval(()=>{s++,(customElements.get(e)||s>=r)&&(clearInterval(i),n())},100)}))}const LE=[{key:"author",label:"Author",icon:"👤"},{key:"license",label:"License",icon:"⚖️"},{key:"copyright",label:"©",icon:""},{key:"language",label:"Language",icon:"🌐"},{key:"gradeLevel",label:"Class",icon:"🏫"},{key:"subject",label:"Subject",icon:"📚"},{key:"contentType",label:"Type",icon:"🏷️"}];function FE({node:e}){const t=e.metadata??{},r=LE.flatMap(n=>{const s=t[n.key];if(!s)return[];const i=Array.isArray(s)?s.join(", "):String(s);return i?[{...n,val:i}]:[]});return r.length?l.jsx("div",{className:ke.infoStrip,children:r.map(n=>l.jsxs("div",{className:ke.infoChip,children:[n.icon&&l.jsx("span",{className:ke.infoChipIcon,children:n.icon}),l.jsx("span",{className:ke.infoChipLabel,children:n.label}),n.val]},n.key))}):null}function $E({node:e,hidden:t}){var n;const r=e.appIcon??((n=e.metadata)==null?void 0:n.appIcon);return l.jsx("div",{className:`${ke.coverOverlay} ${t?ke.coverHidden:""}`,children:r?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:r,alt:e.name,className:ke.coverThumb}),l.jsx("div",{className:ke.coverPlayRing,children:l.jsx("div",{className:ke.coverPlayIcon})}),l.jsx("span",{className:ke.coverLabel,children:"Loading preview…"})]}):l.jsx("div",{className:ke.coverSkeleton})})}function BE({mimeType:e}){const t=TE(e);return l.jsxs("span",{className:ke.typeBadge,"data-type":t.key,children:[l.jsx("span",{className:ke.typeDot}),t.label]})}const sl=({node:e,editorMode:t,type:r})=>{var s;if(r==="quml")return l.jsx(VE,{node:e,editorMode:t});const n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsxs("div",{className:ke.contentPlayerRoot,children:[l.jsxs("div",{className:ke.stage,children:[l.jsxs("div",{className:ke.playerHeader,children:[n&&l.jsx("img",{src:n,alt:"",className:ke.playerHeaderThumb}),l.jsx("span",{className:ke.playerHeaderTitle,children:e.name}),l.jsx(BE,{mimeType:e.mimeType??""})]}),l.jsx(jE,{node:e})]}),l.jsx(FE,{node:e})]})};function jE({node:e}){Ee(c=>c.editorConfig);const[t,r]=p.useState(()=>Eh(e.mimeType??"")),[n,s]=p.useState(!1),i=p.useRef(null),o=p.useRef(null),a=AE(e,{});return p.useEffect(()=>{s(!1),r(Eh(e.mimeType??""))},[e.identifier,e.mimeType]),p.useEffect(()=>{if(t!=="default-player")return;const c=i.current;c&&(c.src=kE,c.onload=()=>{var u;try{(u=c.contentWindow)==null||u.initializePreview(a)}catch(d){console.error("initializePreview failed",d)}setTimeout(()=>s(!0),300)})},[e.identifier,t]),p.useEffect(()=>{if(t==="default-player")return;const c=o.current;if(!c)return;const u=xE[t];u&&ME(u,t).then(()=>{if(!o.current)return;if(!customElements.get(u)){r("default-player");return}const d=document.createElement(u);d.setAttribute("player-config",JSON.stringify(a)),d.addEventListener("playerEvent",()=>{}),d.addEventListener("telemetryEvent",()=>{}),c.innerHTML="",c.appendChild(d),setTimeout(()=>{try{d.playerConfig=a}catch{}s(!0)},200)})},[e.identifier,t]),l.jsxs("div",{className:ke.aspectRatio,children:[l.jsx($E,{node:e,hidden:n}),t==="default-player"?l.jsx("iframe",{ref:i,id:"contentPlayer",title:e.name,className:ke.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:o,className:ke.playerFrame})]})}function VE({node:e,editorMode:t}){const r=Ee(s=>s.editorConfig),n=p.useRef(null);return p.useEffect(()=>{var a;if(!n.current)return;const s=r==null?void 0:r.context,i={context:{mode:t==="edit"?"edit":"play",pdata:{id:((a=s==null?void 0:s.pdata)==null?void 0:a.id)??"sunbird.portal",ver:"1.0",pid:"sunbird-portal"},contentId:e.identifier,sid:(s==null?void 0:s.sid)??"",uid:(s==null?void 0:s.uid)??"",channel:(s==null?void 0:s.channel)??"",did:(s==null?void 0:s.did)??""},config:{enable:!1,showShare:!1,showDownload:!1,showReplay:!0,showExit:!1},metadata:e.metadata??{},data:{}},o=document.createElement("sunbird-quml-player");o.setAttribute("player-config",JSON.stringify(i)),n.current.innerHTML="",n.current.appendChild(o)},[e.identifier,t]),l.jsx("div",{className:ke.qumlRoot,children:l.jsx("div",{ref:n,className:ke.playerWrapper})})}const Bt={overlay:"_overlay_1856m_1",modal:"_modal_1856m_11",header:"_header_1856m_21",body:"_body_1856m_37",hint:"_hint_1856m_43",list:"_list_1856m_49",item:"_item_1856m_55",selected:"_selected_1856m_68",empty:"_empty_1856m_73",footer:"_footer_1856m_79",cancelBtn:"_cancelBtn_1856m_87",moveBtn:"_moveBtn_1856m_95"};function UE(e,t){const r=[],n=s=>{var i;for(const o of s)o.isFolder&&o.id!==t&&r.push(o),(i=o.children)!=null&&i.length&&n(o.children)};return n(e),r}const zE=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{const{treeData:s,moveNode:i}=Ie(),o=UE(s,r),[a,c]=p.useState(null),u=()=>{a&&(i(e,r,a),n())};return l.jsx("div",{className:Bt.overlay,role:"dialog","aria-label":"Move resource",children:l.jsxs("div",{className:Bt.modal,children:[l.jsxs("div",{className:Bt.header,children:[l.jsxs("span",{children:['Move "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":"Close",children:l.jsx(Br,{size:16})})]}),l.jsxs("div",{className:Bt.body,children:[l.jsx("p",{className:Bt.hint,children:"Select a unit to move this content to:"}),l.jsxs("ul",{className:Bt.list,children:[o.map(d=>l.jsxs("li",{className:`${Bt.item} ${a===d.id?Bt.selected:""}`,onClick:()=>c(d.id),children:[l.jsx(nv,{size:14}),l.jsx("span",{children:d.name})]},d.id)),o.length===0&&l.jsx("li",{className:Bt.empty,children:"No other units available"})]})]}),l.jsxs("div",{className:Bt.footer,children:[l.jsx("button",{className:Bt.cancelBtn,onClick:n,children:"Cancel"}),l.jsx("button",{className:Bt.moveBtn,onClick:u,disabled:!a,children:"Move here"})]})]})})},rr={overlay:"_overlay_pv0x1_1",modal:"_modal_pv0x1_11",header:"_header_pv0x1_21",body:"_body_pv0x1_37",table:"_table_pv0x1_43",pageInput:"_pageInput_pv0x1_61",empty:"_empty_pv0x1_68",footer:"_footer_pv0x1_74",cancelBtn:"_cancelBtn_pv0x1_82",saveBtn:"_saveBtn_pv0x1_90"};function HE(e){const t=[],r=n=>{var s;for(const i of n)!i.isFolder&&(!i.children||i.children.length===0)?t.push(i):(s=i.children)!=null&&s.length&&r(i.children)};return r(e),t}const qE=({onClose:e})=>{const{treeData:t,updateNode:r}=Ie(),n=HE(t),[s,i]=p.useState(()=>Object.fromEntries(n.map(a=>{var c;return[a.id,String(((c=a.metadata)==null?void 0:c.pageNumber)??"")]}))),o=p.useCallback(()=>{for(const[a,c]of Object.entries(s))c!==""&&r(a,{pageNumber:parseInt(c,10)||void 0});e()},[s,r,e]);return l.jsx("div",{className:rr.overlay,role:"dialog","aria-label":"Assign Page Numbers",children:l.jsxs("div",{className:rr.modal,children:[l.jsxs("div",{className:rr.header,children:[l.jsx("span",{children:"Assign Page Numbers"}),l.jsx("button",{onClick:e,"aria-label":"Close",children:l.jsx(Br,{size:16})})]}),l.jsx("div",{className:rr.body,children:n.length===0?l.jsx("p",{className:rr.empty,children:"No content items found in this collection."}):l.jsxs("table",{className:rr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Content"}),l.jsx("th",{children:"Page Number"})]})}),l.jsx("tbody",{children:n.map(a=>l.jsxs("tr",{children:[l.jsx("td",{children:a.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:s[a.id]??"",onChange:c=>i(u=>({...u,[a.id]:c.target.value})),className:rr.pageInput})})]},a.id))})]})}),l.jsxs("div",{className:rr.footer,children:[l.jsx("button",{className:rr.cancelBtn,onClick:e,children:"Cancel"}),l.jsxs("button",{className:rr.saveBtn,onClick:o,children:[l.jsx(hv,{size:14})," Save"]})]})]})})},Ae={container:"_container_1a7t2_1",panelHeader:"_panelHeader_1a7t2_10",panelHeaderLeft:"_panelHeaderLeft_1a7t2_19",panelCollapseBtn:"_panelCollapseBtn_1a7t2_27",titleRow:"_titleRow_1a7t2_46",field:"_field_1a7t2_47",moveBtn:"_moveBtn_1a7t2_64",icon:"_icon_1a7t2_84",nameInput:"_nameInput_1a7t2_93",fieldHeader:"_fieldHeader_1a7t2_118",label:"_label_1a7t2_124",fieldCount:"_fieldCount_1a7t2_133",chips:"_chips_1a7t2_170",chip:"_chip_1a7t2_170",chipRemove:"_chipRemove_1a7t2_188",keywordInput:"_keywordInput_1a7t2_202",input:"_input_1a7t2_207",addBtn:"_addBtn_1a7t2_220",radioGroup:"_radioGroup_1a7t2_234",radioLabel:"_radioLabel_1a7t2_239"},WE=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var F,q;const{updateNode:s,markDirty:i}=Ie(),o=t==="edit",a=zi(e),c=Ee(k=>k.relationalFormConfig),u=k=>c==null?void 0:c.find(L=>L.code===k),d=k=>!c||!!u(k),f=(k,L)=>{var $;return(($=u(k))==null?void 0:$.label)||L},[y,g]=p.useState(!0),b=((F=e.metadata)==null?void 0:F.relationalMetadata)??{},[h,v]=p.useState(b.name??e.name??""),[m,_]=p.useState(""),[S,w]=p.useState(Array.isArray(b.keywords)?b.keywords:Array.isArray((q=e.metadata)==null?void 0:q.keywords)?e.metadata.keywords:[]),[C,D]=p.useState(!!b.optional);p.useEffect(()=>{var L,$;const k=((L=e.metadata)==null?void 0:L.relationalMetadata)??{};v(k.name??e.name??""),w(Array.isArray(k.keywords)?k.keywords:Array.isArray(($=e.metadata)==null?void 0:$.keywords)?e.metadata.keywords:[]),D(!!k.optional)},[e.id]);const x=()=>{h.trim()&&h!==e.name&&(s(e.id,{name:h.trim()}),i())},A=()=>{const k=m.trim();if(k&&!S.includes(k)){const L=[...S,k];w(L),s(e.id,{keywords:L}),i()}_("")},B=k=>{const L=S.filter($=>$!==k);w(L),s(e.id,{keywords:L}),i()},P=k=>{D(k),s(e.id,{optional:k}),i()};return l.jsxs("div",{className:Ae.container,children:[l.jsxs("div",{className:Ae.panelHeader,children:[l.jsxs("div",{className:Ae.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${a.key}`,children:a.label}),o&&l.jsx("button",{type:"button",className:Ae.moveBtn,onClick:r,children:"Move to another unit"})]}),l.jsx("button",{type:"button",className:Ae.panelCollapseBtn,onClick:()=>g(k=>!k),"aria-expanded":y,"aria-label":y?"Collapse metadata panel":"Expand metadata panel",title:y?"Collapse":"Expand",children:y?l.jsx(ls,{size:15}):l.jsx(ev,{size:15})})]}),y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ae.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:"icon",className:Ae.icon}),l.jsx("input",{type:"text",className:Ae.nameInput,value:h,disabled:!o,onChange:k=>v(k.target.value),onBlur:x,placeholder:"Content name"})]}),d("keywords")&&l.jsxs("div",{className:Ae.field,children:[l.jsx("div",{className:Ae.fieldHeader,children:l.jsxs("label",{className:Ae.label,children:[f("keywords","Keywords"),S.length>0&&l.jsx("span",{className:Ae.fieldCount,children:S.length})]})}),S.length>0&&l.jsx("div",{className:Ae.chips,children:S.map(k=>l.jsxs("span",{className:Ae.chip,children:[k,o&&l.jsx("button",{type:"button",className:Ae.chipRemove,onClick:()=>B(k),children:"×"})]},k))}),o&&l.jsxs("div",{className:Ae.keywordInput,children:[l.jsx("input",{type:"text",className:Ae.input,value:m,placeholder:"Add keyword and press Enter",onChange:k=>_(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),A())}}),l.jsx("button",{type:"button",className:Ae.addBtn,onClick:A,children:"Add"})]})]}),d("optional")&&l.jsxs("div",{className:Ae.field,children:[l.jsx("label",{className:Ae.label,children:f("optional","Optional in Collection")}),l.jsxs("div",{className:Ae.radioGroup,children:[l.jsxs("label",{className:Ae.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:C===!0,onChange:()=>P(!0),disabled:!o}),"Yes"]}),l.jsxs("label",{className:Ae.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:C===!1,onChange:()=>P(!1),disabled:!o}),"No"]})]})]})]}),n]})},Is={iconBtn:"_iconBtn_vl14u_1",editable:"_editable_vl14u_14",iconImg:"_iconImg_vl14u_26",placeholder:"_placeholder_vl14u_34",removeBtn:"_removeBtn_vl14u_41"},KE=({nodeId:e,value:t,editable:r})=>{const[n,s]=p.useState(!1),{updateNode:i,markDirty:o}=Ie(),a=u=>{i(e,{appIcon:u}),o(),s(!1)},c=u=>{u.stopPropagation(),i(e,{appIcon:""}),o()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[Is.iconBtn,r?Is.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?"Select app icon":"App icon",onClick:()=>r&&s(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:"App icon",className:Is.iconImg}):l.jsx("div",{className:Is.placeholder,children:l.jsx(Mc,{size:18})}),t&&r&&l.jsx("button",{type:"button",className:Is.removeBtn,onClick:c,"aria-label":"Remove icon",children:l.jsx(Uo,{size:11})})]}),n&&l.jsx(gh,{nodeId:e,currentValue:t,onSelect:a,onClose:()=>s(!1)})]})},Qt={leafContentLayout:"_leafContentLayout_1e8xj_1",container:"_container_1e8xj_17",emptyState:"_emptyState_1e8xj_26",titleRow:"_titleRow_1e8xj_36",nodeTitle:"_nodeTitle_1e8xj_52",formArea:"_formArea_1e8xj_74",contentListArea:"_contentListArea_1e8xj_78",dropZone:"_dropZone_1e8xj_83",reviewComment:"_reviewComment_1e8xj_90",reviewCommentLabel:"_reviewCommentLabel_1e8xj_103",reviewCommentText:"_reviewCommentText_1e8xj_109"},GE=["application/vnd.sunbird.questionset"],QE=({editorMode:e,onToolbarEvent:t})=>{var F,q,k,L;const[r,n]=p.useState("details"),[s,i]=p.useState([]),[o,a]=p.useState(null),[c,u]=p.useState(!1),d=p.useRef(null),f=p.useRef(),{selectedNodeId:y,breadcrumb:g,activeNodeMeta:b,updateNode:h,treeData:v}=Ie(),m=Ee($=>{var ee,R,H,te;return((R=(ee=$.editorConfig)==null?void 0:ee.context)==null?void 0:R.contentId)??((te=(H=$.editorConfig)==null?void 0:H.context)==null?void 0:te.identifier)??""}),_=y?Oh(v,y):null,S=!!_&&!_.parent,w=!!(_!=null&&_.isFolder),C=_&&GE.includes(_.mimeType??""),D=_&&!_.isFolder&&!C&&!S,x=((F=_==null?void 0:_.metadata)==null?void 0:F.rejectComment)??(S?(k=(q=v[0])==null?void 0:q.metadata)==null?void 0:k.rejectComment:void 0),A=p.useCallback(()=>{const $=d.current;if(!$||!y)return;const ee=$.innerText.trim();clearTimeout(f.current),f.current=setTimeout(()=>{h(y,{name:ee})},600)},[y,h]),B=p.useCallback($=>{t({action:"onFormValueChange",data:$})},[t]),P=p.useCallback(($,ee)=>{i(ee),t({action:"onFormStatusChange",data:{isValid:$}})},[t]);return _?C?l.jsx(sl,{node:_,editorMode:e,type:"quml"}):D?l.jsxs("div",{className:Qt.leafContentLayout,children:[l.jsx(sl,{node:_,editorMode:e,type:"content"}),l.jsx(WE,{node:_,editorMode:e,onMoveClick:()=>a(_.identifier),reorderDialog:o?l.jsx(zE,{resourceId:o,resourceName:_.name,currentUnitId:_.parent??"",onClose:()=>a(null)}):null})]}):l.jsxs("div",{className:Qt.container,children:[l.jsx(g0,{crumbs:g}),e==="review"&&x&&l.jsxs("div",{className:Qt.reviewComment,role:"alert",children:[l.jsx("span",{className:Qt.reviewCommentLabel,children:"Reviewer comment:"}),l.jsx("span",{className:Qt.reviewCommentText,children:x})]}),l.jsxs("div",{className:Qt.titleRow,children:[S&&y&&l.jsx(KE,{nodeId:y,value:String(_.appIcon??((L=_.metadata)==null?void 0:L.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:d,className:Qt.nodeTitle,contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:A,onBlur:A,"data-placeholder":"Untitled","aria-label":"Node title",children:_.name})]}),l.jsx(y0,{activeTab:r,onChange:$=>n($),errorTabs:s,visibleTabs:S?void 0:["details"]}),l.jsx("div",{className:Qt.formArea,children:l.jsx(sE,{nodeMetadata:b,activeTab:r,isRoot:S,isFolder:w,editorMode:e,onFormValueChange:B,onFormStatusChange:P},`${y??"none"}:${S?"root":"node"}`)}),(w||S)&&r==="details"&&l.jsx("div",{className:Qt.contentListArea,children:l.jsx(EE,{editorMode:e})}),l.jsx(OE,{isActive:!1,label:"Drop to add content to this unit",nodeId:y??void 0,className:Qt.dropZone}),c&&l.jsx(qE,{contentId:m,onClose:()=>u(!1)})]}):l.jsx("div",{className:Qt.emptyState,children:l.jsx("p",{children:"Select a unit from the outline to edit its details"})})};function Oh(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Oh(r.children,t);if(n)return n}}}const Dh=di((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const i=[...t().allContent,...r];e({allContent:i,totalCount:n,offset:i.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:s}=t();let i=r;if(n&&n!=="all"){const o=n.toLowerCase();i=i.filter(a=>[a.mimeType??"",a.primaryCategory??"",a.contentType??""].join(" ").toLowerCase().includes(o))}if(s&&s.trim()!==""){const o=s.toLowerCase().trim();i=i.filter(a=>(a.name??"").toLowerCase().includes(o))}e({filteredContent:i})}}));async function YE(e){var s;const t={status:["Live"],contentType:["Resource"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((s=(await Ue.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"]}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:s.result)??{};return{content:n.content??[],count:n.count??0}}const RE=20;function Th(){var u;const e=Ee(d=>d.editorConfig),t=Ie(d=>d.selectedNodeId),r=Ie(d=>d.treeData),n=p.useCallback(()=>{if(!t||!r.length)return 0;function d(f,y,g=0){var b;for(const h of f){if(h.id===y)return g;if((b=h.children)!=null&&b.length){const v=d(h.children,y,g+1);if(v>=0)return v}}return-1}return Math.max(0,d(r,t))},[t,r])(),s=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!s)return[...xf];const i=`level${n}`,o=s[i],a=o==null?void 0:o.children,c=a==null?void 0:a.Content;return c!=null&&c.length?c:[...xf]}function XE(){const e=Dh(),t=Ee(f=>{var y,g;return((g=(y=f.editorConfig)==null?void 0:y.context)==null?void 0:g.channel)??""}),r=Th(),n=p.useRef(),s=p.useCallback(async(f="",y="all",g={},b=!0,h=!1)=>{var v,m,_,S,w;e.setLoading(!0);try{const C={status:["Live"],contentType:["Resource"],primaryCategory:y&&y!=="all"?[y]:r};(v=g==null?void 0:g.board)!=null&&v.length&&(C.board=g.board),(m=g==null?void 0:g.medium)!=null&&m.length&&(C.medium=g.medium),(_=g==null?void 0:g.gradeLevel)!=null&&_.length&&(C.gradeLevel=g.gradeLevel),(S=g==null?void 0:g.subject)!=null&&S.length&&(C.subject=g.subject),(w=g==null?void 0:g.primaryCategory)!=null&&w.length&&(C.primaryCategory=g.primaryCategory);const D=b?0:e.offset,{content:x,count:A}=await YE({filters:C,query:f,limit:f?50:RE,offset:D,channel:t||void 0,sortBy:h?{name:"asc"}:{lastUpdatedOn:"desc"}});b?e.setContent(x,A):e.appendContent(x,A)}catch(C){console.error("[useLibrary] load error:",C)}finally{e.setLoading(!1)}},[r,t]);p.useEffect(()=>{s()},[t]);const i=p.useCallback(f=>{e.setSearch(f),clearTimeout(n.current),n.current=setTimeout(()=>s(f,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,s]),o=p.useCallback(f=>{e.setFilter(f),s(e.searchQuery,f,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,s]),a=p.useCallback(f=>{e.setAdvancedFilters(f),s(e.searchQuery,e.activeFilter,f,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,s]),c=p.useCallback(()=>{const f=!e.sortAZ;e.setSortAZ(f),s(e.searchQuery,e.activeFilter,e.advancedFilters,!0,f)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,s]),u=p.useCallback(()=>{e.isLoading||s(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,s]),d=e.allContent.length<e.totalCount;return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:d,search:i,setFilter:o,applyAdvancedFilters:a,toggleSort:c,loadMore:u,refetch:()=>s(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)}}const ur={card:"_card_yw3wq_1",addBtn:"_addBtn_yw3wq_17",dragging:"_dragging_yw3wq_24",ctIcon:"_ctIcon_yw3wq_29",info:"_info_yw3wq_33",name:"_name_yw3wq_41",meta:"_meta_yw3wq_50",added:"_added_yw3wq_78",addedBadge:"_addedBadge_yw3wq_87"},ZE={video:zo,pdf:Fo,h5p:$o,scorm:jo,audio:Bo,quiz:Mo,default:hn},JE=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var y,g;const i=zi(e),o=ZE[i.key]??hn,{attributes:a,listeners:c,setNodeRef:u,isDragging:d}=Oc({id:e.identifier,disabled:!n,data:{type:"library-item",item:e}}),f=()=>{r&&r(e)};return l.jsxs("div",{ref:u,className:[ur.card,d?ur.dragging:"",s?ur.added:""].join(" "),"aria-label":e.name,...n?{...a,...c}:{},role:"listitem",onClick:f,children:[l.jsx("span",{className:[`sbx-ct-sq--${i.key}`,ur.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:ur.info,children:[l.jsx("span",{className:ur.name,title:e.name,children:e.name}),l.jsxs("span",{className:ur.meta,children:[((y=e.organisation)==null?void 0:y[0])??e.channel??"",(g=e.organisation)!=null&&g[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]})]}),s&&l.jsx("span",{className:ur.addedBadge,"aria-label":"Already added",title:"Already added to this collection",children:l.jsx(fn,{size:12})}),!s&&l.jsx("button",{type:"button",className:ur.addBtn,onClick:b=>{b.stopPropagation(),t(e)},"aria-label":`Add ${e.name} to unit`,title:"Add to unit",children:l.jsx(cs,{size:14})})]})},Ih={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},eO=({filters:e,active:t,onChange:r})=>l.jsx("div",{className:Ih.chips,role:"group","aria-label":"Content type filters",children:e.map(n=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===n.value,className:["sbx-chip",t===n.value?"filled":"outline",Ih.chip].join(" "),onClick:()=>r(n.value),children:n.label},n.value))}),Qe={panel:"_panel_1cl11_1",header:"_header_1cl11_10",headerTitle:"_headerTitle_1cl11_19",closeBtn:"_closeBtn_1cl11_25",body:"_body_1cl11_43",section:"_section_1cl11_59",sectionLabel:"_sectionLabel_1cl11_65",chips:"_chips_1cl11_73",chip:"_chip_1cl11_73",active:"_active_1cl11_96",footer:"_footer_1cl11_102",resetBtn:"_resetBtn_1cl11_112",applyBtn:"_applyBtn_1cl11_129"},tO=[{key:"board",label:"Board"},{key:"medium",label:"Medium"},{key:"gradeLevel",label:"Class"},{key:"subject",label:"Subject"}],rO=new Set(["board","medium","gradeLevel","subject","topic"]),nO=({local:e,toggle:t})=>{const r=Th();return r.length?l.jsxs("div",{className:Qe.section,children:[l.jsx("div",{className:Qe.sectionLabel,children:"Primary Category"}),l.jsx("div",{className:Qe.chips,children:r.map(n=>l.jsx("button",{type:"button",className:[Qe.chip,(e.primaryCategory??[]).includes(n)?Qe.active:""].join(" "),onClick:()=>t("primaryCategory",n),children:n},n))})]}):null},sO=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var g,b;const s=Ee(h=>h.editorConfig),i=Ee(h=>h.searchFormConfig),{organisationFramework:o}=ah((g=s==null?void 0:s.context)==null?void 0:g.framework,(b=s==null?void 0:s.context)==null?void 0:b.targetFWIds),[a,c]=p.useState(t),u=i!=null&&i.length?i.filter(h=>rO.has(h.code)).map(h=>({key:h.code,label:h.label||h.code})):tO;p.useEffect(()=>{c(t)},[t]);const d=(h,v)=>{c(m=>{const _=m[h]??[],S=_.includes(v)?_.filter(w=>w!==v):[..._,v];return{...m,[h]:S}})},f=(o==null?void 0:o.categories)??[],y=h=>{var v;return((v=f.find(m=>m.code===h))==null?void 0:v.terms)??[]};return e?l.jsxs("div",{className:Qe.panel,role:"dialog","aria-label":"Filter library","aria-modal":"true",children:[l.jsxs("div",{className:Qe.header,children:[l.jsx("span",{className:Qe.headerTitle,children:"Filters"}),l.jsx("button",{type:"button",className:Qe.closeBtn,onClick:n,"aria-label":"Close filters",children:l.jsx(Br,{size:16})})]}),l.jsxs("div",{className:Qe.body,children:[u.map(({key:h,label:v})=>{const m=y(h);return m.length?l.jsxs("div",{className:Qe.section,children:[l.jsx("div",{className:Qe.sectionLabel,children:v}),l.jsx("div",{className:Qe.chips,children:m.slice(0,20).map(_=>l.jsx("button",{type:"button",className:[Qe.chip,(a[h]??[]).includes(_.name)?Qe.active:""].join(" "),onClick:()=>d(h,_.name),children:_.name},_.identifier))})]},h):null}),l.jsx(nO,{local:a,toggle:d})]}),l.jsxs("div",{className:Qe.footer,children:[l.jsx("button",{type:"button",className:Qe.resetBtn,onClick:()=>c({}),children:"Reset"}),l.jsx("button",{type:"button",className:Qe.applyBtn,onClick:()=>{r(a),n()},children:"Apply"})]})]}):null},Yt={panel:"_panel_447ww_1",header:"_header_447ww_10",title:"_title_447ww_20",headerActions:"_headerActions_447ww_31",iconBtn:"_iconBtn_447ww_38",playerArea:"_playerArea_447ww_56",footer:"_footer_447ww_62",addBtn:"_addBtn_447ww_71",modalOverlay:"_modalOverlay_447ww_90",modalPanel:"_modalPanel_447ww_101"},iO=({content:e,onAdd:t,onClose:r})=>{const[n,s]=p.useState(!1);if(!e)return null;const i={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e},o=l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Yt.header,children:[l.jsx("span",{className:Yt.title,title:e.name,children:e.name}),l.jsxs("div",{className:Yt.headerActions,children:[l.jsx("button",{type:"button",className:Yt.iconBtn,onClick:()=>s(a=>!a),"aria-label":n?"Collapse preview":"Expand preview",title:n?"Collapse":"Expand",children:n?l.jsx(av,{size:15}):l.jsx(ov,{size:15})}),l.jsx("button",{type:"button",className:Yt.iconBtn,onClick:r,"aria-label":"Close preview",children:l.jsx(Br,{size:16})})]})]}),l.jsx("div",{className:Yt.playerArea,children:l.jsx(sl,{node:i,editorMode:"read",type:"content"})}),l.jsx("div",{className:Yt.footer,children:l.jsx("button",{type:"button",className:Yt.addBtn,onClick:()=>t(e),children:"+ Add to Unit"})})]});return n?l.jsx("div",{className:Yt.modalOverlay,role:"dialog","aria-modal":"true","aria-label":"Content preview",children:l.jsx("div",{className:Yt.modalPanel,children:o})}):l.jsx("div",{className:Yt.panel,children:o})},De={dock:"_dock_1gzy4_1",header:"_header_1gzy4_8",headerLeft:"_headerLeft_1gzy4_17",headerTitle:"_headerTitle_1gzy4_24",count:"_count_1gzy4_30",searchRow:"_searchRow_1gzy4_39",searchWrap:"_searchWrap_1gzy4_47",searchIcon:"_searchIcon_1gzy4_53",searchInput:"_searchInput_1gzy4_62",filterToggleBtn:"_filterToggleBtn_1gzy4_80",filterToggleBtnActive:"_filterToggleBtnActive_1gzy4_99",filterBadge:"_filterBadge_1gzy4_105",filters:"_filters_1gzy4_124",mainArea:"_mainArea_1gzy4_134",cardList:"_cardList_1gzy4_143",skeleton:"_skeleton_1gzy4_159",skeletonIcon:"_skeletonIcon_1gzy4_169",skeletonText:"_skeletonText_1gzy4_177",skeletonLine:"_skeletonLine_1gzy4_184",skeletonLineSm:"_skeletonLineSm_1gzy4_191",loadMoreBtn:"_loadMoreBtn_1gzy4_206",emptyState:"_emptyState_1gzy4_231",collapseBtn:"_collapseBtn_1gzy4_251"};function oO(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const aO=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const{content:n,isLoading:s,totalCount:i,activeFilter:o,searchQuery:a,sortAZ:c,hasMore:u,search:d,setFilter:f,applyAdvancedFilters:y,toggleSort:g,loadMore:b}=XE(),{addResource:h,selectedNodeId:v,treeData:m}=Ie(),_=e==="edit",[S,w]=p.useState(!1),[C,D]=p.useState({}),[x,A]=p.useState(null),B=p.useMemo(()=>oO(m),[m]),P=p.useCallback($=>{if(!v){ht.error("Select a unit first");return}h($,v),ht.success(`Added "${$.name}"`)},[v,h]),F=p.useCallback($=>{D($),y($)},[y]),q=p.useCallback($=>{A($)},[]),k=p.useCallback($=>{P($),A(null)},[P]),L=p.useMemo(()=>Object.values(C).reduce(($,ee)=>$+((ee==null?void 0:ee.length)??0),0),[C]);return l.jsxs("div",{className:De.dock,children:[l.jsx("div",{className:De.header,children:l.jsxs("div",{className:De.headerLeft,children:[l.jsx("button",{type:"button",className:De.collapseBtn,onClick:r,"aria-label":"Collapse library panel",title:"Collapse library",children:l.jsx(uv,{size:15})}),l.jsx(iv,{size:16}),l.jsx("span",{className:De.headerTitle,children:"Library"}),i>0&&l.jsx("span",{className:De.count,children:i})]})}),l.jsxs("div",{className:De.searchRow,children:[l.jsxs("div",{className:De.searchWrap,children:[l.jsx(Vo,{size:14,className:De.searchIcon}),l.jsx("input",{type:"search",className:De.searchInput,placeholder:"Search content…",value:a,onChange:$=>d($.target.value),"aria-label":"Search library"})]}),l.jsx("button",{type:"button",className:[De.filterToggleBtn,c?De.filterToggleBtnActive:""].join(" "),onClick:g,"aria-label":c?"Sort: A–Z (click for Recent)":"Sort: Recent (click for A–Z)",title:c?"A–Z":"Recent",children:c?l.jsx(Jy,{size:15}):l.jsx(tv,{size:15})}),l.jsxs("button",{type:"button",className:[De.filterToggleBtn,S?De.filterToggleBtnActive:""].join(" "),onClick:()=>w($=>!$),"aria-label":"Toggle advanced filters","aria-pressed":S,title:"Advanced filters",children:[l.jsx(yv,{size:15}),L>0&&l.jsx("span",{className:De.filterBadge,children:L})]})]}),l.jsx("div",{className:De.filters,children:l.jsx(eO,{filters:s0,active:o,onChange:f})}),l.jsxs("div",{className:De.mainArea,children:[l.jsx("div",{className:De.cardList,role:"list","aria-label":"Library content",children:s&&n.length===0?Array.from({length:4}).map(($,ee)=>l.jsxs("div",{className:De.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:De.skeletonIcon}),l.jsxs("div",{className:De.skeletonText,children:[l.jsx("div",{className:De.skeletonLine}),l.jsx("div",{className:De.skeletonLineSm})]})]},ee)):n.length>0?l.jsxs(l.Fragment,{children:[n.map($=>l.jsx(JE,{item:$,onAdd:P,onPreview:q,isDraggable:_,isAdded:B.has($.identifier)},$.identifier)),u&&l.jsx("button",{type:"button",className:De.loadMoreBtn,onClick:b,disabled:s,"aria-label":"Load more content",children:s?"Loading…":"Load More"})]}):l.jsxs("div",{className:De.emptyState,children:[l.jsx(Vo,{size:24}),l.jsx("p",{children:"No content found"}),l.jsx("span",{children:"Try a different search or filter"})]})}),S&&l.jsx("div",{className:De.sidePanelOverlay,children:l.jsx(sO,{isOpen:S,filters:C,onApply:F,onClose:()=>w(!1)})}),x&&l.jsx("div",{className:De.sidePanelOverlay,children:l.jsx(iO,{content:x,onAdd:k,onClose:()=>A(null)})})]})]})};function lO(e,t,r){const n={},s={},i=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional"]),o=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),a=new Set(["audience","attributions","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","medium","gradeLevel","subject","additionalCategories","keywords","language"]),c=new Set(["copyrightYear","compatibilityLevel","version"]);function u(y,g=!1){const b={};for(const[h,v]of Object.entries(y))if(!i.has(h)&&!(g&&o.has(h)))if(a.has(h))Array.isArray(v)?b[h]=v:v!=null&&v!==""?b[h]=[v]:b[h]=[];else if(c.has(h)){const m=Number(v);isNaN(m)||(b[h]=m)}else b[h]=v;return b}function d(y){var b;const g={};for(const h of y.children??[]){if(h.isFolder)continue;const v=t[h.identifier];if(!v)continue;const{isNew:m,..._}=v;if(Object.keys(_).length===0)continue;const S=((b=h.metadata)==null?void 0:b.relationalMetadata)??{};g[h.identifier]={name:h.name,...S,..._}}return g}function f(y,g){var S,w;const b=y.identifier,h=t[b],v=b.startsWith("temp-")||!!(h!=null&&h.isNew),m=!y.isFolder&&!g;if(g||v||h&&!m){let C;if(v)C={mimeType:"application/vnd.ekstep.content-collection",code:b,contentType:((S=y.metadata)==null?void 0:S.contentType)??"CourseUnit",primaryCategory:((w=y.metadata)==null?void 0:w.primaryCategory)??"Course Unit",name:y.name,visibility:"Parent",channel:r,...u(y.metadata??{})};else if(g){const{isNew:D,...x}=h??{};C={...u(y.metadata??{},!0),...u(x,!1),name:y.name}}else{const{isNew:D,...x}=h??{};C={name:y.name,visibility:"Parent",...u(x,!0)}}n[b]={metadata:C,objectType:y.objectType||(y.isFolder?"Collection":"Content"),root:g,isNew:v}}const _=y.isFolder?d(y):{};s[b]={name:y.name,children:(y.children??[]).map(C=>C.identifier),...Object.keys(_).length>0?{relationalMetadata:_}:{},root:g},(y.children??[]).forEach(C=>f(C,!1))}return e.forEach((y,g)=>f(y,g===0)),{nodesModified:n,hierarchy:s}}function cO(){const[e,t]=p.useState(!1),r=p.useRef(),n=Ie(d=>d.treeCache),s=Ie(d=>d.treeData),i=Ee(d=>d.isDirty),{setIsDirty:o,setLastSaved:a}=Ee(),c=Ee(d=>d.editorConfig),u=p.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;const f=c.context.channel??"",y=c.context.userId??c.context.uid??"";t(!0);try{const{nodesModified:g,hierarchy:b}=lO(s,n,f);await Ib(d,g,b,y);const h=new Date().toISOString();a(h),o(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),ht.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,s,n,o,a]);return p.useEffect(()=>{if(i)return clearTimeout(r.current),r.current=setTimeout(u,1500),()=>clearTimeout(r.current)},[i,n,u]),{save:u,isSaving:e,isDirty:i,lastSaved:Ee.getState().lastSaved}}const Nt={shell:"_shell_90fon_1",workspace:"_workspace_90fon_8",sidebarCollapsed:"_sidebarCollapsed_90fon_16",dockCollapsed:"_dockCollapsed_90fon_19",dock:"_dock_90fon_19",outline:"_outline_90fon_40",reopenTab:"_reopenTab_90fon_45",outlineHidden:"_outlineHidden_90fon_79",editor:"_editor_90fon_86",dockHidden:"_dockHidden_90fon_101",dockReopenTab:"_dockReopenTab_90fon_108",dragChip:"_dragChip_90fon_133",dragChipLabel:"_dragChipLabel_90fon_148"},uO=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const[s,i]=p.useState(null),[o,a]=p.useState(!1),[c,u]=p.useState(!1),{addResource:d,treeData:f}=Ie(),y=Ie(C=>C.selectedNodeId),{save:g,isSaving:b,isDirty:h,lastSaved:v}=cO(),m=Gl(Co(si,{activationConstraint:{distance:8}})),_=p.useCallback(C=>{var x;const D=(x=C.active.data.current)==null?void 0:x.item;D&&i(D)},[]),S=p.useCallback(C=>{var P,F;i(null);const D=(P=C.active.data.current)==null?void 0:P.item;if(!D)return;const x=C.over,A=(x==null?void 0:x.id)??y??void 0;if(!A){ht.error("Drop onto a unit to add content");return}const B=(F=f[0])==null?void 0:F.id;if(A===B){ht.error("Drop content onto a unit, not directly on the course.");return}d(D,A),r==null||r(D,A),ht.success(`Added "${D.name}" to unit`)},[y,d,r]),w=p.useCallback(C=>{C.action==="saveCollection"&&g().then(()=>{n==null||n(f)}),t==null||t(C)},[g,t,n,f]);return l.jsxs(Cc,{sensors:m,onDragStart:_,onDragEnd:S,children:[l.jsxs("div",{className:Nt.shell,children:[l.jsx(Kb,{editorMode:e,isSaving:b,isDirty:h,lastSaved:v,onToolbarEvent:w}),l.jsxs("div",{className:[Nt.workspace,o?Nt.sidebarCollapsed:"",c?Nt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Nt.outline,o?Nt.outlineHidden:""].join(" "),"aria-label":"Course outline","aria-hidden":o,children:l.jsx(p0,{editorMode:e,collapsed:o,onToggleCollapse:()=>a(C=>!C)})}),o&&l.jsx("button",{className:Nt.reopenTab,onClick:()=>a(!1),title:"Show outline",type:"button",children:"›"}),l.jsx("main",{className:Nt.editor,role:"main","aria-label":"Content editor",children:l.jsx(QE,{editorMode:e,onToolbarEvent:w})}),l.jsx("aside",{className:[Nt.dock,c?Nt.dockHidden:""].filter(Boolean).join(" "),"aria-label":"Content library","aria-hidden":c,children:l.jsx(aO,{editorMode:e,collapsed:c,onToggleCollapse:()=>u(C=>!C)})}),c&&l.jsx("button",{className:Nt.dockReopenTab,onClick:()=>u(!1),title:"Show library",type:"button",children:"‹"})]})]}),l.jsx(Qy,{dropAnimation:null,children:s?l.jsx("div",{className:Nt.dragChip,children:l.jsx("span",{className:Nt.dragChipLabel,children:s.name})}):null})]})},dO="v4";function fO(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Nh(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:fO(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Dr(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const s=n.title??n.name??void 0;for(const i of n.fields)i.code&&r.push(Nh(i,s))}else n.code&&r.push(Nh(n));return r.sort((n,s)=>(n.index??0)-(s.index??0))}function hO(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function pO(e,t,r="Collection"){var c,u;const s=(u=(c=(await Ue.post(`/action/object/category/definition/${dO}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:c.result)==null?void 0:u.objectCategoryDefinition,i=(s==null?void 0:s.forms)??{},o=(s==null?void 0:s.objectMetadata)??{},a=o.config??{};return{rootForm:Dr(i.create),unitForm:Dr(i.unitMetadata),childForm:Dr(i.childMetadata),searchForm:Dr(i.search??i.searchConfig),relationalForm:Dr(i.relationalMetadata),publishChecklist:Dr(i.publishchecklist),reviewChecklist:Dr(i.review),rfcChecklist:Dr(i.requestforchangeschecklist),schemaDefaults:hO(o.schema),frameworkMetadata:a.frameworkMetadata??{},sourcingSettings:a.sourcingSettings??{}}}function gO({config:e,onError:t}){const[r,n]=p.useState(!0),[s,i]=p.useState(null),[o,a]=p.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d}=Ee(),{setTreeData:f,selectNode:y}=Ie();return p.useEffect(()=>{let g=!1;async function b(){var h,v;try{n(!0),i(null),e.apiBaseUrl&&$u(e.apiBaseUrl),c(e),u(e.config.mode);const m=e.context.contentId??e.context.identifier??"";if(m){const{rootNode:_}=await Tb(m);g||(f(_?[_]:[]),_&&y(_.id));const S=e.config.primaryCategory??"Course",w=e.context.channel??"";try{const C=await pO(S,w,e.config.objectType??"Collection");if(!g){d(C);const D=(v=(h=C.sourcingSettings)==null?void 0:h.collection)==null?void 0:v.maxDepth;D&&!e.config.maxDepth&&c({...e,config:{...e.config,maxDepth:D}})}}catch{}}g||a(!0)}catch(m){if(!g){const _=m instanceof Error?m:new Error(String(m));i(_),t==null||t(_)}}finally{g||n(!1)}}return b(),()=>{g=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:o}}const Ns={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},yO=new _p({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});class vO extends p.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsxs("div",{className:Ns.errorState,children:[l.jsx("h3",{children:"Something went wrong"}),l.jsx("p",{children:this.state.error.message}),l.jsx("button",{onClick:()=>this.setState({error:null}),children:"Retry"})]}):this.props.children}}function mO(e){const{isLoading:t,error:r}=gO({config:e,onError:e.onError}),n=Ee(s=>s.editorMode);return t?l.jsxs("div",{className:Ns.loadingState,children:[l.jsx("div",{className:Ns.loadingSpinner}),l.jsx("p",{children:"Loading editor..."})]}):r?l.jsxs("div",{className:Ns.errorState,children:[l.jsx("h3",{children:"Failed to load editor"}),l.jsx("p",{children:r.message})]}):l.jsx("div",{className:`sb-split-builder ${Ns.root}`,children:l.jsx(uO,{editorMode:n,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const xh=e=>l.jsx(vO,{onError:e.onError,children:l.jsxs(Sp,{client:yO,children:[l.jsx(mO,{...e}),l.jsx(wg,{position:"top-right",toastOptions:{duration:3e3}})]})}),Zi=Symbol.for("r2wc.reactRender"),kh=Symbol.for("r2wc.shouldRender"),Ji=Symbol.for("r2wc.root");function bO(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _O(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Ah={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Zi]()}}),e[Zi]()}};function wO(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},i=!1,o=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),u.attachShadow({mode:"open"})),u},a=Object.create(HTMLElement.prototype);a.constructor=o;var c=new Proxy(a,{has:function(u,d){return d in e.propTypes||d in a},set:function(u,d,f,y){return i&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Ah.expando(y,d,f),Reflect.set(u,d,f,y)):(Ah.expando(y,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return o.prototype=c,a.connectedCallback=function(){this[kh]=!0,this[Zi]()},a.disconnectedCallback=function(){typeof r.createRoot=="function"?this[Ji].unmount():r.unmountComponentAtNode(this)},a[Zi]=function(){if(this[kh]===!0){var u={};Object.keys(this).forEach(function(y){s[y]!==!1&&(u[y]=this[y])},this),i=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[Ji]||(this[Ji]=r.createRoot(d)),this[Ji].render(f)):r.render(f,d),i=!1}},e.propTypes&&(o.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return bO(u)}):Object.keys(e.propTypes),a.attributeChangedCallback=function(u,d,f){var y=n.dashStyleAttributes?_O(u):u;this[y]=f}),o}var xs={},ks=Be;if(process.env.NODE_ENV==="production")xs.createRoot=ks.createRoot,xs.hydrateRoot=ks.hydrateRoot;else{var eo=ks.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;xs.createRoot=function(e,t){eo.usingClientEntryPoint=!0;try{return ks.createRoot(e,t)}finally{eo.usingClientEntryPoint=!1}},xs.hydrateRoot=function(e,t,r){eo.usingClientEntryPoint=!0;try{return ks.hydrateRoot(e,t,r)}finally{eo.usingClientEntryPoint=!1}}}function SO(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function CO(e="sb-collection-editor"){if(SO(),typeof customElements>"u"||customElements.get(e))return;const t=wO(xh,p,xs,{});customElements.define(e,t)}pe.CollectionEditor=xh,pe.registerCollectionEditor=CO,pe.setApiBaseUrl=$u,pe.useEditorStore=Ee,pe.useLibraryStore=Dh,pe.useTreeStore=Ie,Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"})});
|