@skill-map/cli 0.32.0 → 0.33.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/cli/tutorial/sm-tutorial/SKILL.md +27 -7
- package/dist/cli.js +851 -318
- package/dist/cli.js.map +1 -1
- package/dist/index.js +206 -15
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +198 -3
- package/dist/kernel/index.js +206 -15
- package/dist/kernel/index.js.map +1 -1
- package/dist/migrations/001_initial.sql +2 -2
- package/dist/ui/chunk-2QZDJSJN.js +1 -0
- package/dist/ui/chunk-5CFY2K3Y.js +135 -0
- package/dist/ui/{chunk-YQIWQVJ6.js → chunk-L3OLNVKI.js} +9 -9
- package/dist/ui/chunk-OKFHCQNJ.js +123 -0
- package/dist/ui/{chunk-47OZB7LR.js → chunk-TKV6TXTI.js} +1 -1
- package/dist/ui/{chunk-WJLIYGWJ.js → chunk-UK5YFHL3.js} +1 -1
- package/dist/ui/{chunk-FEPH4VNB.js → chunk-UMCC32EJ.js} +3 -3
- package/dist/ui/{chunk-VDQLDTTR.js → chunk-YZ7KCL3G.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/ui/main-H7FURBYT.js +2 -0
- package/migrations/001_initial.sql +2 -2
- package/package.json +3 -2
- package/dist/ui/chunk-BCQZKYOD.js +0 -1
- package/dist/ui/chunk-LS2NXZQZ.js +0 -135
- package/dist/ui/chunk-WCE7MTK5.js +0 -123
- package/dist/ui/main-LJIHL73M.js +0 -2
|
@@ -66,7 +66,7 @@ CREATE TABLE scan_links (
|
|
|
66
66
|
source_path TEXT NOT NULL,
|
|
67
67
|
target_path TEXT NOT NULL,
|
|
68
68
|
kind TEXT NOT NULL,
|
|
69
|
-
confidence
|
|
69
|
+
confidence REAL NOT NULL,
|
|
70
70
|
sources_json TEXT NOT NULL,
|
|
71
71
|
original_trigger TEXT,
|
|
72
72
|
normalized_trigger TEXT,
|
|
@@ -75,7 +75,7 @@ CREATE TABLE scan_links (
|
|
|
75
75
|
location_offset INTEGER,
|
|
76
76
|
raw TEXT,
|
|
77
77
|
CONSTRAINT ck_scan_links_kind CHECK (kind IN ('invokes','references','mentions','supersedes')),
|
|
78
|
-
CONSTRAINT ck_scan_links_confidence CHECK (confidence
|
|
78
|
+
CONSTRAINT ck_scan_links_confidence CHECK (confidence >= 0.0 AND confidence <= 1.0)
|
|
79
79
|
);
|
|
80
80
|
CREATE INDEX ix_scan_links_source_path ON scan_links(source_path);
|
|
81
81
|
CREATE INDEX ix_scan_links_target_path ON scan_links(target_path);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as o,O as i,Tb as n,Y as p,Z as h,da as r,ea as u,id as c,jd as m,nd as f}from"./chunk-LTQTJU54.js";var I={triggerLabel:"Settings",triggerTooltip:"Settings",modalTitle:"Settings",closeLabel:"Close",sections:{plugins:"Plugins",general:"General",project:"Project",changelog:"Changelog",about:"About"},general:{heading:"General",intro:"Per-machine preferences. The update-check toggle is the only setting that lives outside the project; it persists at `~/.skill-map/settings.json` and follows you across projects.",loadErrorPrefix:"Could not load preferences:",saveErrorPrefix:"Could not save preferences:",toggles:{"updateCheck.enabled":{label:"Check for updates",description:"Check npm for newer @skill-map/cli releases."}},localPreferences:{heading:"This browser",intro:"Visual preferences saved in this browser only. They won't sync to another machine."},extraTheme:{label:"Theme",description:"Pick a specialty theme. Overrides the topbar dark/light toggle while active; click that toggle to exit.",options:{none:{label:"None",description:"Use the topbar dark/light toggle."},matrix:{label:"Matrix",description:"Cyber-green retint on the dark palette."}}}},project:{heading:"Project",intro:"These settings apply only to this project and are saved in its `.skill-map/settings.local.json` file.",loadErrorPrefix:"Could not load project settings:",saveErrorPrefix:"Could not save project settings:",referencePathsLabel:"Folders for link validation",referencePathsDescription:'Folders checked only to validate links. Files here are not indexed and do not appear in the graph, they just stop "broken link" warnings when a link points to a real file outside this project.',referencePathsPlaceholder:"~/Documents/research",commaForbidden:"Add one path at a time, without commas.",addPathLabel:"Add path",removePathLabel:"Remove",confirmDialogHeader:"Allow access to folders outside this project?",confirmDialogIntro:"This change lets the scan read files in:",confirmDialogAccept:"Allow access",confirmDialogReject:"Cancel",ignorePatternsLabel:"Ignored patterns",ignorePatternsDescription:"Patterns that exclude files and folders from the scan, stored in `.skillmapignore` at the project root. Same syntax as `.gitignore` (one pattern per line). Comments (`# ...`) and blank lines in the file are preserved on save; the list below only shows active patterns.",ignorePatternsPlaceholder:"secrets.md",ignorePatternEmpty:"Pattern cannot be empty or whitespace-only.",ignorePatternHasControlChar:"Pattern must be a single line without control characters.",ignorePatternDuplicate:"This pattern is already in the list.",addIgnorePatternLabel:"Add pattern",removeIgnorePatternLabel:"Remove",activeProviderLabel:"Active provider",activeProviderDescription:"Selects which provider sees this project. The graph reflects how the chosen provider interprets your files. Switching clears the persisted scan so the graph regenerates under the new lens; jobs and history are kept.",activeProviderSourceConfig:"Set in settings.json.",activeProviderSourceAutodetect:"Auto-detected from your files (no value saved yet).",activeProviderSourceNone:"No provider detected. Install or enable a provider to start.",activeProviderDetectedPrefix:"Detected on disk:",activeProviderEmptyOption:"(none)",activeProviderConfirmHeader:"Switch the active provider?",activeProviderConfirmIntro:"Switching will clear the persisted scan (nodes, links, issues). Jobs and history are kept. You will need to run `sm scan` after the switch.",activeProviderConfirmAccept:"Switch and clear scan",activeProviderConfirmReject:"Cancel",activeProviderSwitchedPrefix:"Lens switched. Cleared",activeProviderSwitchedSuffix:"scan table(s). Run `sm scan` to repopulate.",activeProviderSwitchedNoDb:"Lens switched. Run `sm scan` to populate the graph under the new lens."},changelogHeading:"Changelog",changelogIntro:"What's new in skill-map. Each entry covers a release of @skill-map/cli (the CLI + bundled UI) and lists the user-facing changes plus the workspace(s) each one affects.",changelogEmpty:"No release notes yet. Future releases will populate this list automatically from the changesets shipped in each PR.",changelogInternalRelease:"Internal release. Focus on stability, infra, and refactors. No user-facing changes this time.",changelogAffectedPackages:"Affected packages",aboutHeading:"About",aboutIntro:"Version information for the running CLI / server.",aboutCliLabel:"skill-map CLI",aboutSpecLabel:"Spec version",aboutSchemaLabel:"Schema version",aboutFolderLabel:"Project folder",aboutDbLabel:"Project DB",aboutDbValue:(t,e)=>t==="present"?e:`${t} \xB7 ${e}`,aboutLoading:"Loading\u2026",aboutUnknown:"-",aboutErrorPrefix:"Could not read health endpoint:",aboutLinksHeading:"Links",aboutWebsiteLabel:"Website",aboutGithubLabel:"GitHub",aboutWebsiteUrl:"https://skill-map.dev/",aboutGithubUrl:"https://github.com/crystian/skill-map",aboutStarHeading:"Enjoying skill-map?",aboutStarBody:"If it's useful to you, drop us a star on GitHub, it helps a lot and keeps the project alive.",aboutStarCta:"Star on GitHub",aboutStarA11y:"Open the skill-map repository on GitHub to give it a star",pluginsHeading:"Plugins",pluginsIntro:"Enable or disable installed plugins.",pluginsSearchPlaceholder:"Filter by name\u2026",pluginsSearchA11y:"Filter plugins by name",pluginsSearchEmpty:t=>`No plugins match "${t}".`,pluginsKindFilterAll:"All",pluginsKindFilterA11y:"Filter plugins by kind",pluginsKindFilterOptionA11y:(t,e)=>e?`Show only ${t} extensions`:"Show all kinds",unsavedChangesMessage:t=>t===1?'1 unsaved change. Click "Apply" to persist it.':`${t} unsaved changes. Click "Apply" to persist them.`,startsAsDisabledRowHint:"This plugin started disabled and is not loaded in memory. Restart `sm serve` for the change to take effect.",startsAsDisabledFooterHint:"Some plugins were disabled when the server started. Consider restarting `sm serve` so they take effect.",discardChanges:"Discard",applyAndClose:"Apply",discardA11y:"Discard pending plugin changes",applyA11y:"Apply pending plugin changes and refresh the graph",confirmCloseTitle:"Apply pending changes?",confirmCloseBody:t=>t===1?"You have 1 unsaved change.":`You have ${t} unsaved changes.`,keepEditing:"Keep editing",sourceBuiltIn:"Built-in",sourceProject:"Project",enabledLabel:"Enabled",disabledLabel:"Disabled",lockedLabel:"Locked",lockedTooltip:"Locked by the host (cannot be toggled).",expandLabel:"Show extensions",collapseLabel:"Hide extensions",statusFailure:{"incompatible-spec":"Incompatible spec version","invalid-manifest":"Invalid manifest","load-error":"Failed to load","id-collision":"Plugin id collision"},loading:"Loading plugins\u2026",empty:"No plugins installed.",errorPrefix:"Could not load plugins:",toggleErrorPrefix:"Toggle failed:",a11y:{triggerLabel:"Open settings",pluginToggle:(t,e)=>e?`Enable plugin ${t}`:`Disable plugin ${t}`,extensionToggle:(t,e)=>e?`Enable ${t}`:`Disable ${t}`,pluginRow:t=>`Plugin ${t} row`,extensionRow:t=>`Extension ${t} row`}};var v={available:"Update available",tooltip:t=>`v${t} is available. Run \`npm i -g @skill-map/cli@latest\` to update.`,a11yLabel:t=>`Update available: version ${t}`,versionLabel:t=>`v${t}`,versionTooltip:t=>`skill-map CLI v${t}`,versionA11yLabel:t=>`Running version ${t}`,fetchFailed:t=>`UpdateCheckService: fetch failed (${t})`};var b=class t{dataSource=i(c);status=r(null);isOutdated=n(()=>this.status()?.isOutdated===!0);latest=n(()=>this.status()?.latest??null);current=n(()=>this.status()?.current??null);async load(){try{let e=await this.dataSource.getUpdateStatus();this.status.set(e)}catch(e){let a=e instanceof Error?e.message:String(e);console.warn(v.fetchFailed(a))}}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})};var S={scanFailed:t=>`scan-trigger failed: ${t}`};var k=class t{dataSource=i(c);loader=i(f);scanning=r(!1);scanError=r(null);async run(){if(!this.scanning()){this.scanning.set(!0),this.scanError.set(null);try{await this.dataSource.runScan(),await this.loader.load()}catch(e){let a=e instanceof m||e instanceof Error?e.message:String(e);this.scanError.set(a),console.warn(S.scanFailed(a))}finally{this.scanning.set(!1)}}}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})};var T="skill-map.ui.theme",g="skill-map.ui.extra-theme",w="app-dark",A="dark",x="app-matrix",P="(prefers-color-scheme: dark)",C="favicon.svg",D="favicon-matrix.svg",L='link[rel="icon"][type="image/svg+xml"]',E=class t{doc=i(p);destroyRef=i(h);mode=r(this.readInitialMode());extraTheme=r(this.readInitialExtra());systemPrefersDark=r(this.readSystemPref());resolved=n(()=>{let e=this.mode();return e==="auto"?this.systemPrefersDark()?"dark":"light":e});constructor(){this.subscribeToSystemPref(),u(()=>{let e=this.extraTheme(),s=this.resolved()==="dark"||e==="matrix",l=this.doc.documentElement;l.classList.toggle(w,s),l.classList.toggle(A,s),l.classList.toggle(x,e==="matrix"),this.applyFavicon(e==="matrix"?D:C);try{let d=this.doc.defaultView?.localStorage;d?.setItem(T,this.mode()),e===null?d?.removeItem(g):d?.setItem(g,e)}catch{}})}toggle(){this.extraTheme()!==null&&this.extraTheme.set(null),this.mode.update(e=>e==="auto"?"light":e==="light"?"dark":"auto")}set(e){this.mode.set(e)}setExtraTheme(e){this.extraTheme.set(e)}readInitialMode(){try{let e=this.doc.defaultView?.localStorage.getItem(T);if(e==="auto"||e==="light"||e==="dark")return e}catch{}return"auto"}readInitialExtra(){try{let e=this.doc.defaultView?.localStorage.getItem(g);if(e==="matrix")return e}catch{}return null}readSystemPref(){try{return this.doc.defaultView?.matchMedia(P).matches??!1}catch{return!1}}applyFavicon(e){let a=this.doc.querySelector(L);a&&a.getAttribute("href")!==e&&a.setAttribute("href",e)}subscribeToSystemPref(){let e=this.doc.defaultView;if(!e||typeof e.matchMedia!="function")return;let a=e.matchMedia(P),s=l=>{this.systemPrefersDark.set(l.matches)};a.addEventListener("change",s),this.destroyRef.onDestroy(()=>a.removeEventListener("change",s))}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})};export{v as a,b,I as c,k as d,E as e};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import{$ as B,Aa as f,Ba as Fe,Ea as st,Ha as at,Hb as A,I as O,Ic as bt,J as q,Jb as Se,Jc as pe,K as x,Ka as de,Lc as me,M as D,Na as R,O as C,Oa as j,Oc as Y,Pc as X,Sb as E,Ta as G,Tb as M,Ua as we,V as nt,Va as Ie,Vc as N,Wa as lt,Wb as g,Wc as ve,Xb as a,Z as it,Za as dt,_c as Dt,ab as Ne,ad as Mt,bc as Oe,cc as I,d as Xe,da as V,dc as mt,ea as ae,ec as xe,fa as ot,fb as H,ga as v,gc as Te,h as Je,hb as K,ia as z,ib as ut,jb as ct,kb as ht,mb as ue,n as et,nb as ce,oa as Z,oc as vt,pa as rt,pc as he,ra as Q,sa as c,t as tt,tb as ft,vb as k,wa as P,wb as gt,xa as T,xb as pt,ya as p,za as le}from"./chunk-LTQTJU54.js";import{J as _t,L as ge,Q as Le,U as Ct,b as fe,d as ke,g as yt,ga as Be}from"./chunk-3SI3TVER.js";import{a as y,b as w}from"./chunk-VB56BUGO.js";var an=["data-p-icon","times"],vi=(()=>{class t extends Dt{static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275cmp=P({type:t,selectors:[["","data-p-icon","times"]],features:[f],attrs:an,decls:1,vars:0,consts:[["d","M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z","fill","currentColor"]],template:function(i,o){i&1&&(nt(),dt(0,"path",0))},encapsulation:2})}return t})();var ln=Object.defineProperty,Vt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,At=(t,n,e)=>n in t?ln(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,Et=(t,n)=>{for(var e in n||(n={}))dn.call(n,e)&&At(t,e,n[e]);if(Vt)for(var e of Vt(n))un.call(n,e)&&At(t,e,n[e]);return t},cn=(t,n,e)=>new Promise((i,o)=>{var r=l=>{try{d(e.next(l))}catch(u){o(u)}},s=l=>{try{d(e.throw(l))}catch(u){o(u)}},d=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,s);d((e=e.apply(t,n)).next())}),ye="animation",ee="transition";function hn(t){return t?t.disabled||!!(t.safe&&_t()):!1}function fn(t,n){return t?Et(Et({},t),Object.entries(n).reduce((e,[i,o])=>{var r;return e[i]=(r=t[i])!=null?r:o,e},{})):n}function gn(t){let{name:n,enterClass:e,leaveClass:i}=t||{};return{enter:{from:e?.from||`${n}-enter-from`,to:e?.to||`${n}-enter-to`,active:e?.active||`${n}-enter-active`},leave:{from:i?.from||`${n}-leave-from`,to:i?.to||`${n}-leave-to`,active:i?.active||`${n}-leave-active`}}}function pn(t){return{enter:{onBefore:t?.onBeforeEnter,onStart:t?.onEnter,onAfter:t?.onAfterEnter,onCancelled:t?.onEnterCancelled},leave:{onBefore:t?.onBeforeLeave,onStart:t?.onLeave,onAfter:t?.onAfterLeave,onCancelled:t?.onLeaveCancelled}}}function mn(t,n){let e=window.getComputedStyle(t),i=_=>{let S=e[`${_}Delay`],F=e[`${_}Duration`];return[S.split(", ").map(Be),F.split(", ").map(Be)]},[o,r]=i(ee),[s,d]=i(ye),l=Math.max(...r.map((_,S)=>_+o[S])),u=Math.max(...d.map((_,S)=>_+s[S])),h,m=0,b=0;return n===ee?l>0&&(h=ee,m=l,b=r.length):n===ye?u>0&&(h=ye,m=u,b=d.length):(m=Math.max(l,u),h=m>0?l>u?ee:ye:void 0,b=h?h===ee?r.length:d.length:0),{type:h,timeout:m,count:b}}function _e(t,n){return typeof t=="number"?t:typeof t=="object"&&t[n]!=null?t[n]:null}function vn(t,n=!0,e=!1){if(!n&&!e)return;let i=yt(t);n&&Le(t,"--pui-motion-height",i.height+"px"),e&&Le(t,"--pui-motion-width",i.width+"px")}var yn={name:"p",safe:!0,disabled:!1,enter:!0,leave:!0,autoHeight:!0,autoWidth:!1};function Pe(t,n){if(!t)throw new Error("Element is required.");let e={},i=!1,o={},r=null,s={},d=h=>{if(Object.assign(e,fn(h,yn)),!e.enter&&!e.leave)throw new Error("Enter or leave must be true.");s=pn(e),i=hn(e),o=gn(e),r=null},l=h=>cn(null,null,function*(){r?.();let{onBefore:m,onStart:b,onAfter:_,onCancelled:S}=s[h]||{},F={element:t};if(i){m?.(F),b?.(F),_?.(F);return}let{from:ze,active:Ze,to:Qe}=o[h]||{};return vn(t,e.autoHeight,e.autoWidth),m?.(F),fe(t,ze),fe(t,Ze),t.offsetHeight,ke(t,ze),fe(t,Qe),b?.(F),new Promise(Ke=>{let rn=_e(e.duration,h),Ye=()=>{ke(t,[Qe,Ze]),r=null},sn=()=>{Ye(),_?.(F),Ke()};r=()=>{Ye(),S?.(F),Ke()},Cn(t,e.type,rn,sn)})});d(n);let u={enter:()=>e.enter?l("enter"):Promise.resolve(),leave:()=>e.leave?l("leave"):Promise.resolve(),cancel:()=>{r?.(),r=null},update:(h,m)=>{if(!h)throw new Error("Element is required.");t=h,u.cancel(),d(m)}};return e.appear&&u.enter(),u}var _n=0;function Cn(t,n,e,i){let o=t._motionEndId=++_n,r=()=>{o===t._motionEndId&&i()};if(e!=null)return setTimeout(r,e);let{type:s,timeout:d,count:l}=mn(t,n);if(!s){i();return}let u=s+"end",h=0,m=()=>{t.removeEventListener(u,b,!0),r()},b=_=>{_.target===t&&++h>=l&&m()};t.addEventListener(u,b,{capture:!0,once:!0}),setTimeout(()=>{h<l&&m()},d+1)}var Dn=["*"];function Mn(t,n){t&1&&ct(0)}var Ce=new WeakMap;function te(t,n){if(t)switch(Ce.has(t)||Ce.set(t,{display:t.style.display,visibility:t.style.visibility,maxHeight:t.style.maxHeight,overflow:t.style.overflow}),n){case"display":t.style.display="none";break;case"visibility":t.style.visibility="hidden",t.style.maxHeight="0",t.style.overflow="hidden";break}}function be(t,n){if(!t)return;let e=Ce.get(t)??t.style;switch(n){case"display":t.style.display=e?.display||"";break;case"visibility":t.style.visibility=e?.visibility||"",t.style.maxHeight=e?.maxHeight||"",t.style.overflow=e?.overflow||"";break}Ce.delete(t)}var Vn=`
|
|
2
|
+
.p-motion {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
`,An={root:"p-motion"},Re=(()=>{class t extends me{name="motion";style=Vn;classes=An;static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275prov=q({token:t,factory:t.\u0275fac})}return t})();var Ft=new D("MOTION_INSTANCE"),En=(()=>{class t extends X{$pcMotion=C(Ft,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=C(N,{self:!0});onAfterViewChecked(){let i=this.options()?.root||{};this.bindDirectiveInstance.setAttrs(y(y({},this.ptms(["host","root"])),i))}_componentStyle=C(Re);visible=a(!1);mountOnEnter=a(!0);unmountOnLeave=a(!0);name=a(void 0);type=a(void 0);safe=a(void 0);disabled=a(!1);appear=a(!1);enter=a(!0);leave=a(!0);duration=a(void 0);hideStrategy=a("display");enterFromClass=a(void 0);enterToClass=a(void 0);enterActiveClass=a(void 0);leaveFromClass=a(void 0);leaveToClass=a(void 0);leaveActiveClass=a(void 0);options=a({});onBeforeEnter=g();onEnter=g();onAfterEnter=g();onEnterCancelled=g();onBeforeLeave=g();onLeave=g();onAfterLeave=g();onLeaveCancelled=g();motionOptions=M(()=>{let e=this.options();return{name:e.name??this.name(),type:e.type??this.type(),safe:e.safe??this.safe(),disabled:e.disabled??this.disabled(),appear:!1,enter:e.enter??this.enter(),leave:e.leave??this.leave(),duration:e.duration??this.duration(),enterClass:{from:e.enterClass?.from??(e.name?void 0:this.enterFromClass()),to:e.enterClass?.to??(e.name?void 0:this.enterToClass()),active:e.enterClass?.active??(e.name?void 0:this.enterActiveClass())},leaveClass:{from:e.leaveClass?.from??(e.name?void 0:this.leaveFromClass()),to:e.leaveClass?.to??(e.name?void 0:this.leaveToClass()),active:e.leaveClass?.active??(e.name?void 0:this.leaveActiveClass())},onBeforeEnter:e.onBeforeEnter??this.handleBeforeEnter,onEnter:e.onEnter??this.handleEnter,onAfterEnter:e.onAfterEnter??this.handleAfterEnter,onEnterCancelled:e.onEnterCancelled??this.handleEnterCancelled,onBeforeLeave:e.onBeforeLeave??this.handleBeforeLeave,onLeave:e.onLeave??this.handleLeave,onAfterLeave:e.onAfterLeave??this.handleAfterLeave,onLeaveCancelled:e.onLeaveCancelled??this.handleLeaveCancelled}});motion;isInitialMount=!0;cancelled=!1;destroyed=!1;rendered=V(!1);handleBeforeEnter=e=>!this.destroyed&&this.onBeforeEnter.emit(e);handleEnter=e=>!this.destroyed&&this.onEnter.emit(e);handleAfterEnter=e=>!this.destroyed&&this.onAfterEnter.emit(e);handleEnterCancelled=e=>!this.destroyed&&this.onEnterCancelled.emit(e);handleBeforeLeave=e=>!this.destroyed&&this.onBeforeLeave.emit(e);handleLeave=e=>!this.destroyed&&this.onLeave.emit(e);handleAfterLeave=e=>!this.destroyed&&this.onAfterLeave.emit(e);handleLeaveCancelled=e=>!this.destroyed&&this.onLeaveCancelled.emit(e);constructor(){super(),ae(()=>{let e=this.hideStrategy();this.isInitialMount?(te(this.$el,e),this.rendered.set(this.visible()&&this.mountOnEnter()||!this.mountOnEnter())):this.visible()&&!this.rendered()&&(te(this.$el,e),this.rendered.set(!0))}),ae(()=>{this.motion||(this.motion=Pe(this.$el,this.motionOptions()))}),xe(async()=>{if(!this.$el)return;let e=this.isInitialMount&&this.visible()&&this.appear(),i=this.hideStrategy();this.visible()?(await ge(),be(this.$el,i),(e||!this.isInitialMount)&&(this.applyMotionDuration("enter"),this.motion?.enter())):this.isInitialMount||(await ge(),this.applyMotionDuration("leave"),this.motion?.leave()?.then(async()=>{this.$el&&!this.cancelled&&!this.visible()&&(te(this.$el,i),this.unmountOnLeave()&&(await ge(),this.cancelled||this.rendered.set(!1)))})),this.isInitialMount=!1})}applyMotionDuration(e){let i=E(this.motionOptions),o=_e(i.duration,e);if(o==null||!this.$el)return;let r=this.$el,s=`${o}ms`;i.type==="transition"?r.style.transitionDuration=s:r.style.animationDuration=s}onDestroy(){this.destroyed=!0,this.cancelled=!0,this.motion?.cancel(),this.motion=void 0,be(this.$el,this.hideStrategy()),this.$el?.remove(),this.isInitialMount=!0}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=P({type:t,selectors:[["p-motion"]],hostVars:2,hostBindings:function(i,o){i&2&&k(o.cx("root"))},inputs:{visible:[1,"visible"],mountOnEnter:[1,"mountOnEnter"],unmountOnLeave:[1,"unmountOnLeave"],name:[1,"name"],type:[1,"type"],safe:[1,"safe"],disabled:[1,"disabled"],appear:[1,"appear"],enter:[1,"enter"],leave:[1,"leave"],duration:[1,"duration"],hideStrategy:[1,"hideStrategy"],enterFromClass:[1,"enterFromClass"],enterToClass:[1,"enterToClass"],enterActiveClass:[1,"enterActiveClass"],leaveFromClass:[1,"leaveFromClass"],leaveToClass:[1,"leaveToClass"],leaveActiveClass:[1,"leaveActiveClass"],options:[1,"options"]},outputs:{onBeforeEnter:"onBeforeEnter",onEnter:"onEnter",onAfterEnter:"onAfterEnter",onEnterCancelled:"onEnterCancelled",onBeforeLeave:"onBeforeLeave",onLeave:"onLeave",onAfterLeave:"onAfterLeave",onLeaveCancelled:"onLeaveCancelled"},features:[A([Re,{provide:Ft,useExisting:t},{provide:Y,useExisting:t}]),le([N]),f],ngContentSelectors:Dn,decls:1,vars:1,template:function(i,o){i&1&&(ut(),R(0,Mn,1,0)),i&2&&j(o.rendered()?0:-1)},dependencies:[he,ve],encapsulation:2})}return t})(),wt=new D("MOTION_DIRECTIVE_INSTANCE"),xi=(()=>{class t extends X{$pcMotionDirective=C(wt,{optional:!0,skipSelf:!0})??void 0;visible=a(!1,{alias:"pMotion"});name=a(void 0,{alias:"pMotionName"});type=a(void 0,{alias:"pMotionType"});safe=a(void 0,{alias:"pMotionSafe"});disabled=a(!1,{alias:"pMotionDisabled"});appear=a(!1,{alias:"pMotionAppear"});enter=a(!0,{alias:"pMotionEnter"});leave=a(!0,{alias:"pMotionLeave"});duration=a(void 0,{alias:"pMotionDuration"});hideStrategy=a("display",{alias:"pMotionHideStrategy"});enterFromClass=a(void 0,{alias:"pMotionEnterFromClass"});enterToClass=a(void 0,{alias:"pMotionEnterToClass"});enterActiveClass=a(void 0,{alias:"pMotionEnterActiveClass"});leaveFromClass=a(void 0,{alias:"pMotionLeaveFromClass"});leaveToClass=a(void 0,{alias:"pMotionLeaveToClass"});leaveActiveClass=a(void 0,{alias:"pMotionLeaveActiveClass"});options=a({},{alias:"pMotionOptions"});onBeforeEnter=g({alias:"pMotionOnBeforeEnter"});onEnter=g({alias:"pMotionOnEnter"});onAfterEnter=g({alias:"pMotionOnAfterEnter"});onEnterCancelled=g({alias:"pMotionOnEnterCancelled"});onBeforeLeave=g({alias:"pMotionOnBeforeLeave"});onLeave=g({alias:"pMotionOnLeave"});onAfterLeave=g({alias:"pMotionOnAfterLeave"});onLeaveCancelled=g({alias:"pMotionOnLeaveCancelled"});motionOptions=M(()=>{let e=this.options()??{};return{name:e.name??this.name(),type:e.type??this.type(),safe:e.safe??this.safe(),disabled:e.disabled??this.disabled(),appear:!1,enter:e.enter??this.enter(),leave:e.leave??this.leave(),duration:e.duration??this.duration(),enterClass:{from:e.enterClass?.from??(e.name?void 0:this.enterFromClass()),to:e.enterClass?.to??(e.name?void 0:this.enterToClass()),active:e.enterClass?.active??(e.name?void 0:this.enterActiveClass())},leaveClass:{from:e.leaveClass?.from??(e.name?void 0:this.leaveFromClass()),to:e.leaveClass?.to??(e.name?void 0:this.leaveToClass()),active:e.leaveClass?.active??(e.name?void 0:this.leaveActiveClass())},onBeforeEnter:e.onBeforeEnter??this.handleBeforeEnter,onEnter:e.onEnter??this.handleEnter,onAfterEnter:e.onAfterEnter??this.handleAfterEnter,onEnterCancelled:e.onEnterCancelled??this.handleEnterCancelled,onBeforeLeave:e.onBeforeLeave??this.handleBeforeLeave,onLeave:e.onLeave??this.handleLeave,onAfterLeave:e.onAfterLeave??this.handleAfterLeave,onLeaveCancelled:e.onLeaveCancelled??this.handleLeaveCancelled}});motion;isInitialMount=!0;cancelled=!1;destroyed=!1;handleBeforeEnter=e=>!this.destroyed&&this.onBeforeEnter.emit(e);handleEnter=e=>!this.destroyed&&this.onEnter.emit(e);handleAfterEnter=e=>!this.destroyed&&this.onAfterEnter.emit(e);handleEnterCancelled=e=>!this.destroyed&&this.onEnterCancelled.emit(e);handleBeforeLeave=e=>!this.destroyed&&this.onBeforeLeave.emit(e);handleLeave=e=>!this.destroyed&&this.onLeave.emit(e);handleAfterLeave=e=>!this.destroyed&&this.onAfterLeave.emit(e);handleLeaveCancelled=e=>!this.destroyed&&this.onLeaveCancelled.emit(e);constructor(){super(),ae(()=>{this.motion||(this.motion=Pe(this.$el,this.motionOptions()))}),xe(()=>{if(!this.$el)return;let e=this.isInitialMount&&this.visible()&&this.appear(),i=this.hideStrategy();this.visible()?(be(this.$el,i),(e||!this.isInitialMount)&&(this.applyMotionDuration("enter"),this.motion?.enter())):this.isInitialMount?te(this.$el,i):(this.applyMotionDuration("leave"),this.motion?.leave()?.then(()=>{this.$el&&!this.cancelled&&!this.visible()&&te(this.$el,i)})),this.isInitialMount=!1})}applyMotionDuration(e){let i=E(this.motionOptions),o=_e(i.duration,e);if(o==null||!this.$el)return;let r=this.$el,s=`${o}ms`;i.type==="transition"?r.style.transitionDuration=s:r.style.animationDuration=s}onDestroy(){this.destroyed=!0,this.cancelled=!0,this.motion?.cancel(),this.motion=void 0,be(this.$el,this.hideStrategy()),this.$el?.remove(),this.isInitialMount=!0}static \u0275fac=function(i){return new(i||t)};static \u0275dir=p({type:t,selectors:[["","pMotion",""]],inputs:{visible:[1,"pMotion","visible"],name:[1,"pMotionName","name"],type:[1,"pMotionType","type"],safe:[1,"pMotionSafe","safe"],disabled:[1,"pMotionDisabled","disabled"],appear:[1,"pMotionAppear","appear"],enter:[1,"pMotionEnter","enter"],leave:[1,"pMotionLeave","leave"],duration:[1,"pMotionDuration","duration"],hideStrategy:[1,"pMotionHideStrategy","hideStrategy"],enterFromClass:[1,"pMotionEnterFromClass","enterFromClass"],enterToClass:[1,"pMotionEnterToClass","enterToClass"],enterActiveClass:[1,"pMotionEnterActiveClass","enterActiveClass"],leaveFromClass:[1,"pMotionLeaveFromClass","leaveFromClass"],leaveToClass:[1,"pMotionLeaveToClass","leaveToClass"],leaveActiveClass:[1,"pMotionLeaveActiveClass","leaveActiveClass"],options:[1,"pMotionOptions","options"]},outputs:{onBeforeEnter:"pMotionOnBeforeEnter",onEnter:"pMotionOnEnter",onAfterEnter:"pMotionOnAfterEnter",onEnterCancelled:"pMotionOnEnterCancelled",onBeforeLeave:"pMotionOnBeforeLeave",onLeave:"pMotionOnLeave",onAfterLeave:"pMotionOnAfterLeave",onLeaveCancelled:"pMotionOnLeaveCancelled"},features:[A([Re,{provide:wt,useExisting:t},{provide:Y,useExisting:t}]),f]})}return t})(),Ti=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=T({type:t});static \u0275inj=x({imports:[En]})}return t})();var Bt=(()=>{class t{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||t)(c(Q),c(z))};static \u0275dir=p({type:t})}return t})(),We=(()=>{class t extends Bt{static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275dir=p({type:t,features:[f]})}return t})(),W=new D("");var Fn={provide:W,useExisting:O(()=>Pt),multi:!0};function wn(){let t=Te()?Te().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}var In=new D(""),Pt=(()=>{class t extends Bt{_compositionMode;_composing=!1;constructor(e,i,o){super(e,i),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!wn())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||t)(c(Q),c(z),c(In,8))};static \u0275dir=p({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&H("input",function(s){return o._handleInput(s.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(s){return o._compositionEnd(s.target.value)})},standalone:!1,features:[A([Fn]),f]})}return t})();var Nn=new D(""),Sn=new D("");function Rt(t){return t!=null}function jt(t){return st(t)?Je(t):t}function Gt(t){let n={};return t.forEach(e=>{n=e!=null?y(y({},n),e):n}),Object.keys(n).length===0?null:n}function Ht(t,n){return n.map(e=>e(t))}function On(t){return!t.validate}function $t(t){return t.map(n=>On(n)?n:e=>n.validate(e))}function xn(t){if(!t)return null;let n=t.filter(Rt);return n.length==0?null:function(e){return Gt(Ht(e,n))}}function Ut(t){return t!=null?xn($t(t)):null}function Tn(t){if(!t)return null;let n=t.filter(Rt);return n.length==0?null:function(e){let i=Ht(e,n).map(jt);return tt(i).pipe(et(Gt))}}function Wt(t){return t!=null?Tn($t(t)):null}function It(t,n){return t===null?[n]:Array.isArray(t)?[...t,n]:[t,n]}function kn(t){return t._rawValidators}function Ln(t){return t._rawAsyncValidators}function je(t){return t?Array.isArray(t)?t:[t]:[]}function Me(t,n){return Array.isArray(t)?t.includes(n):t===n}function Nt(t,n){let e=je(n);return je(t).forEach(o=>{Me(e,o)||e.push(o)}),e}function St(t,n){return je(n).filter(e=>!Me(t,e))}var Ve=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(n){this._rawValidators=n||[],this._composedValidatorFn=Ut(this._rawValidators)}_setAsyncValidators(n){this._rawAsyncValidators=n||[],this._composedAsyncValidatorFn=Wt(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(n){this._onDestroyCallbacks.push(n)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(n=>n()),this._onDestroyCallbacks=[]}reset(n=void 0){this.control?.reset(n)}hasError(n,e){return this.control?this.control.hasError(n,e):!1}getError(n,e){return this.control?this.control.getError(n,e):null}},Ge=class extends Ve{name;get formDirective(){return null}get path(){return null}},se=class extends Ve{_parent=null;name=null;valueAccessor=null},He=class{_cd;constructor(n){this._cd=n}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var to=(()=>{class t extends He{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(c(se,2))};static \u0275dir=p({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&ft("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[f]})}return t})();var ne="VALID",De="INVALID",$="PENDING",ie="DISABLED",L=class{},Ae=class extends L{value;source;constructor(n,e){super(),this.value=n,this.source=e}},oe=class extends L{pristine;source;constructor(n,e){super(),this.pristine=n,this.source=e}},re=class extends L{touched;source;constructor(n,e){super(),this.touched=n,this.source=e}},U=class extends L{status;source;constructor(n,e){super(),this.status=n,this.source=e}};var $e=class extends L{source;constructor(n){super(),this.source=n}};function Bn(t){return(Ee(t)?t.validators:t)||null}function Pn(t){return Array.isArray(t)?Ut(t):t||null}function Rn(t,n){return(Ee(n)?n.asyncValidators:t)||null}function jn(t){return Array.isArray(t)?Wt(t):t||null}function Ee(t){return t!=null&&!Array.isArray(t)&&typeof t=="object"}var Ue=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(n,e){this._assignValidators(n),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(n){this._rawValidators=this._composedValidatorFn=n}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(n){this._rawAsyncValidators=this._composedAsyncValidatorFn=n}get parent(){return this._parent}get status(){return E(this.statusReactive)}set status(n){E(()=>this.statusReactive.set(n))}_status=M(()=>this.statusReactive());statusReactive=V(void 0);get valid(){return this.status===ne}get invalid(){return this.status===De}get pending(){return this.status===$}get disabled(){return this.status===ie}get enabled(){return this.status!==ie}errors;get pristine(){return E(this.pristineReactive)}set pristine(n){E(()=>this.pristineReactive.set(n))}_pristine=M(()=>this.pristineReactive());pristineReactive=V(!0);get dirty(){return!this.pristine}get touched(){return E(this.touchedReactive)}set touched(n){E(()=>this.touchedReactive.set(n))}_touched=M(()=>this.touchedReactive());touchedReactive=V(!1);get untouched(){return!this.touched}_events=new Xe;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(n){this._assignValidators(n)}setAsyncValidators(n){this._assignAsyncValidators(n)}addValidators(n){this.setValidators(Nt(n,this._rawValidators))}addAsyncValidators(n){this.setAsyncValidators(Nt(n,this._rawAsyncValidators))}removeValidators(n){this.setValidators(St(n,this._rawValidators))}removeAsyncValidators(n){this.setAsyncValidators(St(n,this._rawAsyncValidators))}hasValidator(n){return Me(this._rawValidators,n)}hasAsyncValidator(n){return Me(this._rawAsyncValidators,n)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(n={}){let e=this.touched===!1;this.touched=!0;let i=n.sourceControl??this;n.onlySelf||this._parent?.markAsTouched(w(y({},n),{sourceControl:i})),e&&n.emitEvent!==!1&&this._events.next(new re(!0,i))}markAllAsDirty(n={}){this.markAsDirty({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(n))}markAllAsTouched(n={}){this.markAsTouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(n))}markAsUntouched(n={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=n.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:i})}),n.onlySelf||this._parent?._updateTouched(n,i),e&&n.emitEvent!==!1&&this._events.next(new re(!1,i))}markAsDirty(n={}){let e=this.pristine===!0;this.pristine=!1;let i=n.sourceControl??this;n.onlySelf||this._parent?.markAsDirty(w(y({},n),{sourceControl:i})),e&&n.emitEvent!==!1&&this._events.next(new oe(!1,i))}markAsPristine(n={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=n.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:n.emitEvent})}),n.onlySelf||this._parent?._updatePristine(n,i),e&&n.emitEvent!==!1&&this._events.next(new oe(!0,i))}markAsPending(n={}){this.status=$;let e=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new U(this.status,e)),this.statusChanges.emit(this.status)),n.onlySelf||this._parent?.markAsPending(w(y({},n),{sourceControl:e}))}disable(n={}){let e=this._parentMarkedDirty(n.onlySelf);this.status=ie,this.errors=null,this._forEachChild(o=>{o.disable(w(y({},n),{onlySelf:!0}))}),this._updateValue();let i=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new Ae(this.value,i)),this._events.next(new U(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(w(y({},n),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(n={}){let e=this._parentMarkedDirty(n.onlySelf);this.status=ne,this._forEachChild(i=>{i.enable(w(y({},n),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent}),this._updateAncestors(w(y({},n),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(n,e){n.onlySelf||(this._parent?.updateValueAndValidity(n),n.skipPristineCheck||this._parent?._updatePristine({},e),this._parent?._updateTouched({},e))}setParent(n){this._parent=n}getRawValue(){return this.value}updateValueAndValidity(n={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===ne||this.status===$)&&this._runAsyncValidator(i,n.emitEvent)}let e=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new Ae(this.value,e)),this._events.next(new U(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),n.onlySelf||this._parent?.updateValueAndValidity(w(y({},n),{sourceControl:e}))}_updateTreeValidity(n={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(n)),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ie:ne}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(n,e){if(this.asyncValidator){this.status=$,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:n!==!1};let i=jt(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:n})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let n=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,n}return!1}setErrors(n,e={}){this.errors=n,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(n){let e=n;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,o)=>i&&i._find(o),this)}getError(n,e){let i=e?this.get(e):this;return i?.errors?i.errors[n]:null}hasError(n,e){return!!this.getError(n,e)}get root(){let n=this;for(;n._parent;)n=n._parent;return n}_updateControlsErrors(n,e,i){this.status=this._calculateStatus(),n&&this.statusChanges.emit(this.status),(n||i)&&this._events.next(new U(this.status,e)),this._parent&&this._parent._updateControlsErrors(n,e,i)}_initObservables(){this.valueChanges=new B,this.statusChanges=new B}_calculateStatus(){return this._allControlsDisabled()?ie:this.errors?De:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus($)?$:this._anyControlsHaveStatus(De)?De:ne}_anyControlsHaveStatus(n){return this._anyControls(e=>e.status===n)}_anyControlsDirty(){return this._anyControls(n=>n.dirty)}_anyControlsTouched(){return this._anyControls(n=>n.touched)}_updatePristine(n,e){let i=!this._anyControlsDirty(),o=this.pristine!==i;this.pristine=i,n.onlySelf||this._parent?._updatePristine(n,e),o&&this._events.next(new oe(this.pristine,e))}_updateTouched(n={},e){this.touched=this._anyControlsTouched(),this._events.next(new re(this.touched,e)),n.onlySelf||this._parent?._updateTouched(n,e)}_onDisabledChange=[];_registerOnCollectionChange(n){this._onCollectionChange=n}_setUpdateStrategy(n){Ee(n)&&n.updateOn!=null&&(this._updateOn=n.updateOn)}_parentMarkedDirty(n){return!n&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(n){return null}_assignValidators(n){this._rawValidators=Array.isArray(n)?n.slice():n,this._composedValidatorFn=Pn(this._rawValidators)}_assignAsyncValidators(n){this._rawAsyncValidators=Array.isArray(n)?n.slice():n,this._composedAsyncValidatorFn=jn(this._rawAsyncValidators)}};var qt=new D("",{factory:()=>qe}),qe="always";function Gn(t,n){return[...n.path,t]}function Hn(t,n,e=qe){Un(t,n),n.valueAccessor.writeValue(t.value),(t.disabled||e==="always")&&n.valueAccessor.setDisabledState?.(t.disabled),Wn(t,n),zn(t,n),qn(t,n),$n(t,n)}function Ot(t,n){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(n)})}function $n(t,n){if(n.valueAccessor.setDisabledState){let e=i=>{n.valueAccessor.setDisabledState(i)};t.registerOnDisabledChange(e),n._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}function Un(t,n){let e=kn(t);n.validator!==null?t.setValidators(It(e,n.validator)):typeof e=="function"&&t.setValidators([e]);let i=Ln(t);n.asyncValidator!==null?t.setAsyncValidators(It(i,n.asyncValidator)):typeof i=="function"&&t.setAsyncValidators([i]);let o=()=>t.updateValueAndValidity();Ot(n._rawValidators,o),Ot(n._rawAsyncValidators,o)}function Wn(t,n){n.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,t.updateOn==="change"&&zt(t,n)})}function qn(t,n){n.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,t.updateOn==="blur"&&t._pendingChange&&zt(t,n),t.updateOn!=="submit"&&t.markAsTouched()})}function zt(t,n){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),n.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function zn(t,n){let e=(i,o)=>{n.valueAccessor.writeValue(i),o&&n.viewToModelUpdate(i)};t.registerOnChange(e),n._registerOnDestroy(()=>{t._unregisterOnChange(e)})}function Zn(t,n){if(!t.hasOwnProperty("model"))return!1;let e=t.model;return e.isFirstChange()?!0:!Object.is(n,e.currentValue)}function Qn(t){return Object.getPrototypeOf(t.constructor)===We}function Kn(t,n){if(!n)return null;Array.isArray(n);let e,i,o;return n.forEach(r=>{r.constructor===Pt?e=r:Qn(r)?i=r:o=r}),o||i||e||null}function xt(t,n){let e=t.indexOf(n);e>-1&&t.splice(e,1)}function Tt(t){return typeof t=="object"&&t!==null&&Object.keys(t).length===2&&"value"in t&&"disabled"in t}var Yn=class extends Ue{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(n=null,e,i){super(Bn(e),Rn(i,e)),this._applyFormState(n),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Ee(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Tt(n)?this.defaultValue=n.value:this.defaultValue=n)}setValue(n,e={}){this.value=this._pendingValue=n,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(n,e={}){this.setValue(n,e)}reset(n=this.defaultValue,e={}){this._applyFormState(n),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new $e(this))}_updateValue(){}_anyControls(n){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(n){this._onChange.push(n)}_unregisterOnChange(n){xt(this._onChange,n)}registerOnDisabledChange(n){this._onDisabledChange.push(n)}_unregisterOnDisabledChange(n){xt(this._onDisabledChange,n)}_forEachChild(n){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(n){Tt(n)?(this.value=this._pendingValue=n.value,n.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=n}};var Xn={provide:se,useExisting:O(()=>Jn)},kt=Promise.resolve(),Jn=(()=>{class t extends se{_changeDetectorRef;callSetDisabledState;control=new Yn;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new B;constructor(e,i,o,r,s,d){super(),this._changeDetectorRef=s,this.callSetDisabledState=d,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Kn(this,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Zn(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Hn(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){kt.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,o=i!==0&&I(i);kt.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Gn(e,this._parent):[e]}static \u0275fac=function(i){return new(i||t)(c(Ge,9),c(Nn,10),c(Sn,10),c(W,10),c(Oe,8),c(qt,8))};static \u0275dir=p({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[A([Xn]),f,ot]})}return t})();var ei={provide:W,useExisting:O(()=>Qt),multi:!0};function Zt(t,n){return t==null?`${n}`:(n&&typeof n=="object"&&(n="Object"),`${t}: ${n}`.slice(0,50))}function ti(t){return t.split(":")[0]}var Qt=(()=>{class t extends We{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=C(at).injector;destroyRef=C(it);cdr=C(Oe);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,rt({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),o=Zt(i,e);this.setProperty("value",o)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=ti(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275dir=p({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,o){i&1&&H("change",function(s){return o.onChange(s.target.value)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[A([ei]),f]})}return t})(),io=(()=>{class t{_element;_renderer;_select;id;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(Zt(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select?._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||t)(c(z),c(Q),c(Qt,9))};static \u0275dir=p({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return t})(),ni={provide:W,useExisting:O(()=>Kt),multi:!0};function Lt(t,n){return t==null?`${n}`:(typeof n=="string"&&(n=`'${n}'`),n&&typeof n=="object"&&(n="Object"),`${t}: ${n}`.slice(0,50))}function ii(t){return t.split(":")[0]}var Kt=(()=>{class t extends We{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let o=e.map(r=>this._getOptionId(r));i=(r,s)=>{r._setSelected(o.indexOf(s.toString())>-1)}}else i=(o,r)=>{o._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let o=[],r=i.selectedOptions;if(r!==void 0){let s=r;for(let d=0;d<s.length;d++){let l=s[d],u=this._getOptionValue(l.value);o.push(u)}}else{let s=i.options;for(let d=0;d<s.length;d++){let l=s[d];if(l.selected){let u=this._getOptionValue(l.value);o.push(u)}}}this.value=o,e(o)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=ii(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275dir=p({type:t,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,o){i&1&&H("change",function(s){return o.onChange(s.target)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[A([ni]),f]})}return t})(),oo=(()=>{class t{_element;_renderer;_select;id;_value;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Lt(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Lt(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||t)(c(z),c(Q),c(Kt,9))};static \u0275dir=p({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return t})();var oi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=T({type:t});static \u0275inj=x({})}return t})();var ro=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:qt,useValue:e.callSetDisabledState??qe}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=T({type:t});static \u0275inj=x({imports:[oi]})}return t})();var Yt=`
|
|
6
|
+
.p-togglebutton {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
user-select: none;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
position: relative;
|
|
12
|
+
color: dt('togglebutton.color');
|
|
13
|
+
background: dt('togglebutton.background');
|
|
14
|
+
border: 1px solid dt('togglebutton.border.color');
|
|
15
|
+
padding: dt('togglebutton.padding');
|
|
16
|
+
font-size: 1rem;
|
|
17
|
+
font-family: inherit;
|
|
18
|
+
font-feature-settings: inherit;
|
|
19
|
+
transition:
|
|
20
|
+
background dt('togglebutton.transition.duration'),
|
|
21
|
+
color dt('togglebutton.transition.duration'),
|
|
22
|
+
border-color dt('togglebutton.transition.duration'),
|
|
23
|
+
outline-color dt('togglebutton.transition.duration'),
|
|
24
|
+
box-shadow dt('togglebutton.transition.duration');
|
|
25
|
+
border-radius: dt('togglebutton.border.radius');
|
|
26
|
+
outline-color: transparent;
|
|
27
|
+
font-weight: dt('togglebutton.font.weight');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.p-togglebutton-content {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
gap: dt('togglebutton.gap');
|
|
36
|
+
padding: dt('togglebutton.content.padding');
|
|
37
|
+
background: transparent;
|
|
38
|
+
border-radius: dt('togglebutton.content.border.radius');
|
|
39
|
+
transition:
|
|
40
|
+
background dt('togglebutton.transition.duration'),
|
|
41
|
+
color dt('togglebutton.transition.duration'),
|
|
42
|
+
border-color dt('togglebutton.transition.duration'),
|
|
43
|
+
outline-color dt('togglebutton.transition.duration'),
|
|
44
|
+
box-shadow dt('togglebutton.transition.duration');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {
|
|
48
|
+
background: dt('togglebutton.hover.background');
|
|
49
|
+
color: dt('togglebutton.hover.color');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.p-togglebutton.p-togglebutton-checked {
|
|
53
|
+
background: dt('togglebutton.checked.background');
|
|
54
|
+
border-color: dt('togglebutton.checked.border.color');
|
|
55
|
+
color: dt('togglebutton.checked.color');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.p-togglebutton-checked .p-togglebutton-content {
|
|
59
|
+
background: dt('togglebutton.content.checked.background');
|
|
60
|
+
box-shadow: dt('togglebutton.content.checked.shadow');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.p-togglebutton:focus-visible {
|
|
64
|
+
box-shadow: dt('togglebutton.focus.ring.shadow');
|
|
65
|
+
outline: dt('togglebutton.focus.ring.width') dt('togglebutton.focus.ring.style') dt('togglebutton.focus.ring.color');
|
|
66
|
+
outline-offset: dt('togglebutton.focus.ring.offset');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.p-togglebutton.p-invalid {
|
|
70
|
+
border-color: dt('togglebutton.invalid.border.color');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.p-togglebutton:disabled {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
cursor: default;
|
|
76
|
+
background: dt('togglebutton.disabled.background');
|
|
77
|
+
border-color: dt('togglebutton.disabled.border.color');
|
|
78
|
+
color: dt('togglebutton.disabled.color');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.p-togglebutton-label,
|
|
82
|
+
.p-togglebutton-icon {
|
|
83
|
+
position: relative;
|
|
84
|
+
transition: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.p-togglebutton-icon {
|
|
88
|
+
color: dt('togglebutton.icon.color');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {
|
|
92
|
+
color: dt('togglebutton.icon.hover.color');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {
|
|
96
|
+
color: dt('togglebutton.icon.checked.color');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.p-togglebutton:disabled .p-togglebutton-icon {
|
|
100
|
+
color: dt('togglebutton.icon.disabled.color');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.p-togglebutton-sm {
|
|
104
|
+
padding: dt('togglebutton.sm.padding');
|
|
105
|
+
font-size: dt('togglebutton.sm.font.size');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.p-togglebutton-sm .p-togglebutton-content {
|
|
109
|
+
padding: dt('togglebutton.content.sm.padding');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.p-togglebutton-lg {
|
|
113
|
+
padding: dt('togglebutton.lg.padding');
|
|
114
|
+
font-size: dt('togglebutton.lg.font.size');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.p-togglebutton-lg .p-togglebutton-content {
|
|
118
|
+
padding: dt('togglebutton.content.lg.padding');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.p-togglebutton-fluid {
|
|
122
|
+
width: 100%;
|
|
123
|
+
}
|
|
124
|
+
`;var Xt=(()=>{class t extends X{modelValue=V(void 0);$filled=M(()=>Ct(this.modelValue()));writeModelValue(e){this.modelValue.set(e)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275dir=p({type:t,features:[f]})}return t})();var Jt=(()=>{class t extends Xt{required=a(void 0,{transform:I});invalid=a(void 0,{transform:I});disabled=a(void 0,{transform:I});name=a();_disabled=V(!1);$disabled=M(()=>this.disabled()||this._disabled());onModelChange=()=>{};onModelTouched=()=>{};writeDisabledState(e){this._disabled.set(e)}writeControlValue(e,i){}writeValue(e){this.writeControlValue(e,this.writeModelValue.bind(this))}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.writeDisabledState(e),this.cd.markForCheck()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275dir=p({type:t,inputs:{required:[1,"required"],invalid:[1,"invalid"],disabled:[1,"disabled"],name:[1,"name"]},features:[f]})}return t})();var ri=["icon"],si=["content"],nn=t=>({$implicit:t});function ai(t,n){t&1&&Ne(0)}function li(t,n){if(t&1&<(0,"span",0),t&2){let e=K(3);k(e.cn(e.cx("icon"),e.checked?e.onIcon:e.offIcon,e.iconPos==="left"?e.cx("iconLeft"):e.cx("iconRight"))),G("pBind",e.ptm("icon"))}}function di(t,n){if(t&1&&R(0,li,1,3,"span",2),t&2){let e=K(2);j(e.onIcon||e.offIcon?0:-1)}}function ui(t,n){t&1&&Ne(0)}function ci(t,n){if(t&1&&Fe(0,ui,1,0,"ng-container",1),t&2){let e=K(2);G("ngTemplateOutlet",e.iconTemplate||e._iconTemplate)("ngTemplateOutletContext",Se(2,nn,e.checked))}}function hi(t,n){if(t&1&&(R(0,di,1,1)(1,ci,1,4,"ng-container"),we(2,"span",0),gt(3),Ie()),t&2){let e=K();j(e.iconTemplate?1:0),Z(2),k(e.cx("label")),G("pBind",e.ptm("label")),Z(),pt(e.checked?e.hasOnLabel?e.onLabel:"\xA0":e.hasOffLabel?e.offLabel:"\xA0")}}var fi=`
|
|
125
|
+
${Yt}
|
|
126
|
+
|
|
127
|
+
/* For PrimeNG (iconPos) */
|
|
128
|
+
.p-togglebutton-icon-right {
|
|
129
|
+
order: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.p-togglebutton.ng-invalid.ng-dirty {
|
|
133
|
+
border-color: dt('togglebutton.invalid.border.color');
|
|
134
|
+
}
|
|
135
|
+
`,gi={root:({instance:t})=>["p-togglebutton p-component",{"p-togglebutton-checked":t.checked,"p-invalid":t.invalid(),"p-disabled":t.$disabled(),"p-togglebutton-sm p-inputfield-sm":t.size==="small","p-togglebutton-lg p-inputfield-lg":t.size==="large","p-togglebutton-fluid":t.fluid()}],content:"p-togglebutton-content",icon:"p-togglebutton-icon",iconLeft:"p-togglebutton-icon-left",iconRight:"p-togglebutton-icon-right",label:"p-togglebutton-label"},en=(()=>{class t extends me{name="togglebutton";style=fi;classes=gi;static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275prov=q({token:t,factory:t.\u0275fac})}return t})();var tn=new D("TOGGLEBUTTON_INSTANCE"),pi={provide:W,useExisting:O(()=>on),multi:!0},on=(()=>{class t extends Jt{componentName="ToggleButton";$pcToggleButton=C(tn,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=C(N,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}onKeyDown(e){switch(e.code){case"Enter":this.toggle(e),e.preventDefault();break;case"Space":this.toggle(e),e.preventDefault();break}}toggle(e){!this.$disabled()&&!(this.allowEmpty===!1&&this.checked)&&(this.checked=!this.checked,this.writeModelValue(this.checked),this.onModelChange(this.checked),this.onModelTouched(),this.onChange.emit({originalEvent:e,checked:this.checked}),this.cd.markForCheck())}onLabel="Yes";offLabel="No";onIcon;offIcon;ariaLabel;ariaLabelledBy;styleClass;inputId;tabindex=0;iconPos="left";autofocus;size;allowEmpty;fluid=a(void 0,{transform:I});onChange=new B;iconTemplate;contentTemplate;templates;checked=!1;onInit(){(this.checked===null||this.checked===void 0)&&(this.checked=!1)}_componentStyle=C(en);onBlur(){this.onModelTouched()}get hasOnLabel(){return this.onLabel&&this.onLabel.length>0}get hasOffLabel(){return this.offLabel&&this.offLabel.length>0}get active(){return this.checked===!0}_iconTemplate;_contentTemplate;onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"icon":this._iconTemplate=e.template;break;case"content":this._contentTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}writeControlValue(e,i){this.checked=e,i(e),this.cd.markForCheck()}get dataP(){return this.cn({checked:this.active,invalid:this.invalid(),[this.size]:this.size})}static \u0275fac=(()=>{let e;return function(o){return(e||(e=v(t)))(o||t)}})();static \u0275cmp=P({type:t,selectors:[["p-toggleButton"],["p-togglebutton"],["p-toggle-button"]],contentQueries:function(i,o,r){if(i&1&&ht(r,ri,4)(r,si,4)(r,bt,4),i&2){let s;ue(s=ce())&&(o.iconTemplate=s.first),ue(s=ce())&&(o.contentTemplate=s.first),ue(s=ce())&&(o.templates=s)}},hostVars:11,hostBindings:function(i,o){i&1&&H("keydown",function(s){return o.onKeyDown(s)})("click",function(s){return o.toggle(s)}),i&2&&(de("aria-labelledby",o.ariaLabelledBy)("aria-label",o.ariaLabel)("aria-pressed",o.checked?"true":"false")("role","button")("tabindex",o.tabindex!==void 0?o.tabindex:o.$disabled()?-1:0)("data-pc-name","togglebutton")("data-p-checked",o.active)("data-p-disabled",o.$disabled())("data-p",o.dataP),k(o.cn(o.cx("root"),o.styleClass)))},inputs:{onLabel:"onLabel",offLabel:"offLabel",onIcon:"onIcon",offIcon:"offIcon",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",styleClass:"styleClass",inputId:"inputId",tabindex:[2,"tabindex","tabindex",mt],iconPos:"iconPos",autofocus:[2,"autofocus","autofocus",I],size:"size",allowEmpty:"allowEmpty",fluid:[1,"fluid"]},outputs:{onChange:"onChange"},features:[A([pi,en,{provide:tn,useExisting:t},{provide:Y,useExisting:t}]),le([Mt,N]),f],decls:3,vars:9,consts:[[3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"class","pBind"]],template:function(i,o){i&1&&(we(0,"span",0),Fe(1,ai,1,0,"ng-container",1),R(2,hi,4,5),Ie()),i&2&&(k(o.cx("content")),G("pBind",o.ptm("content")),de("data-p",o.dataP),Z(),G("ngTemplateOutlet",o.contentTemplate||o._contentTemplate)("ngTemplateOutletContext",Se(7,nn,o.checked)),Z(),j(o.contentTemplate?-1:2))},dependencies:[he,vt,pe,ve,N],encapsulation:2,changeDetection:0})}return t})(),Ro=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=T({type:t});static \u0275inj=x({imports:[on,pe,pe]})}return t})();export{vi as a,En as b,xi as c,Ti as d,W as e,Pt as f,se as g,to as h,Jn as i,Qt as j,io as k,oo as l,ro as m,Xt as n,Jt as o,on as p,Ro as q};
|