if(typeof ct=="undefined")throw"ct required";if(function(n,t){String.prototype.trimStart=function(n,i){return t.str.trimStart(this,n,i)};t.isNull(n.od)&&(n.od={viewModels:{},classes:{},services:{},enums:{}})}(window,window.ct),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.settings)&&(t.settings={});t.settings.AppRoot="";t.settings.TemplateRoot="";t.settings.PagerButtonsCount=5;t.settings.SupportEmail="MyCaseHelp@courts.in.gov";t.settings.AccessCodes={Enabled:!1,CodeLength:10,CodeExpire:90,ActivateExpire:21};n.isNull(t.links)&&(t.links={});let i="https://mycase.in.gov/Link/";$.extend(t.links,{Login:null,Logout:null,Register:null,Help:i+"Help",TermsOfUse:i+"TermsOfUse",PrivacyPolicy:i+"PrivacyPolicy",CourtContacts:i+"CourtContacts",OdysseyCourts:i+"OdysseyCourts",TrialCourtsAndClerks:i+"TrialCourtsAndClerks"});t.initLinks=function(i,r,u,f){let o=n.fixStr(r,n.pa.LoginUrlFull),s=n.fixStr(u,n.pa.LogoutUrlFull),h=n.fixStr(f,n.pa.RegisterUrlFull),e=n.str.tail(n.fixStr(i,n.pa.ModuleUrlFull),"/")+"Link/";$.extend(t.links,{Login:o,Logout:s,Register:h,Help:e+"Help",TermsOfUse:e+"TermsOfUse",PrivacyPolicy:e+"PrivacyPolicy",CourtContacts:e+"CourtContacts",OdysseyCourts:e+"OdysseyCourts",TrialCourtsAndClerks:e+"TrialCourtsAndClerks"})};n.isNull(t.enums)&&(t.enums={});t.enums.Dropdowns={Location:"LOCATION",CourtItems:"DDCourtItems"};t.enums.ActiveFlag={All:"All",Open:"Open",Closed:"Closed"};t.enums.CategoryGroup={All:"All",Criminal:"Criminal",Civil:"Civil",Appellate:"Appellate"};t.enums.PartyCon={Other:0,Attorney:1,Defendant:2,Plaintiff:3,Appellant:4,Appellee:5};t.CaseSorts={CaseNumber:{Lbl:"Case Number",Val:"CaseNumber"},FileDate:{Lbl:"File Date",Val:"FileDate"},Title:{Lbl:"Case Style",Val:"CaseStyle"},StatusDate:{Lbl:"Status Date",Val:"CaseStatusDate"},getLabel:function(i){let r=t.CaseSorts;for(var u in r)if(n.str.eq(r[u].Val,i,!0))return r[u].Lbl;return null}}}(window.ct,window.od),typeof jQuery=="undefined")throw"jQuery required";if(typeof _=="undefined")throw"_ required";if(typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof window.ct.pa=="undefined")throw"ct.pa required";if(typeof od=="undefined")throw"od required";if(function(n,t,i,r,u){i.onError=function(n){!r.isNull(r.pa)&&r.isFunc(r.pa.reportError)&&r.pa.reportError(null,n,"Knockout onError",null,n)};r.isNull(u.ko)&&(u.ko={});r.isNull(u.ko.uniqueIDs)&&(u.ko.uniqueIDs={Seed:100,Prefix:"id"},u.ko.uniqueIDs.nextID=function(){return this.Seed+=1,this.Seed>999999&&(this.Seed=100),this.Prefix+this.Seed+r.utility.guid.RandStr(5).toUpperCase()},i.subscribable.fn.getUniqueID=function(){return r.str.isNullOrWS(this.$uniqueID)&&(this.$uniqueID=u.ko.uniqueIDs.nextID()),this.$uniqueID});i.bindingHandlers.idFor={init:function(n,t){var r=t();i.isSubscribable(r)&&(n.id=r.getUniqueID())}};i.bindingHandlers.labelFor={init:function(t,r){var u=r();i.isSubscribable(u)&&n(t).attr("for",u.getUniqueID())}};i.bindingHandlers.focus={init:function(t,i){var f=n(t),u=r.isNull(i)?0:r.fixInt(i(),0);u>0?setTimeout(function(){n(t).focus()},u):n(t).focus()}};i.bindingHandlers.blur={init:function(t,i){var f=n(t),u=r.isNull(i)?0:r.fixInt(i(),0);u>0?setTimeout(function(){n(t).blur()},u):n(t).blur()}};i.bindingHandlers.mask={update:function(t,i){var f=n(t),u=r.isNull(i)?null:r.fixStr(i(),null,!0);if(!r.isNull(u))try{f.mask(u)}catch(e){}}};i.bindingHandlers.enterKey={init:function(t,u,f,e){var s=n(t),o=u();r.isNull(s)||r.isTrue(s.data("entTgtSet"))||(s.data("entTgtSet",!0),s.keydown(function(n){if(n.which==13)try{var t=!0;return r.isNull(o.enabled)?r.isNull(o.disabled)||(t=i.isObservable(o.disabled)||r.isFunc(o.disabled)?!r.isTruish(o.disabled()):!r.isTruish(o.disabled)):t=i.isObservable(o.enabled)||r.isFunc(o.enabled)?r.isTruish(o.enabled()):r.isTruish(o.enabled),t?o.click(e,n):r.stopEvent(n)}catch(u){return r.stopEvent(n)}}))}};i.bindingHandlers.noEnter={init:function(t,u){var e=n(t),f=u();r.isNull(e)||r.isTrue(e.data("noEnter"))||(e.data("noEnter",!0),e.keydown(function(n){if(n.which==13)try{var t=r.isNull(f)?!1:i.isObservable(f)||r.isFunc(f)?r.isTruish(f()):r.isTruish(f);return t?r.stopEvent(n):!0}catch(u){return!0}}))}};i.bindingHandlers.valOnBlur={init:function(t,u){var e=n(t),f=u();e.length<=0||r.isNull(f)||r.isBool(f)&&f===!1||e.blur(function(){return r.isArray(f)&&!r.arr.isEmpty(f)?r.arr.each(f,function(n){if(r.isNull(n))return!0;i.isSubscribable(n)&&r.isFunc(n.Validate)&&n.Validate.call(n,!0,!0)},!1,!1):!r.isNull(f)&&i.isSubscribable(f)&&!r.isNull(f.valid)&&r.isFunc(f.valid.Validate)&&f.valid.Validate.call(f,!0,!0),!0})}};i.bindingHandlers.alsoValidate={init:function(t,u){var e=n(t),f=u();e.length>0&&!r.isNull(f)&&e.change(function(){return r.isArray(f)&&!r.arr.isEmpty(f)?r.arr.each(f,function(n){r.isNull(n)||i.isSubscribable(n)&&r.isFunc(n.ManualValidate)&&n.ManualValidate.call(n)},!1,!1):!r.isNull(f)&&i.isSubscribable(f)&&r.isFunc(f.ManualValidate)&&f.ManualValidate.call(f),!0})}};i.bindingHandlers.maxLen={init:function(t,u){let f=n(t),e=r.fixInt(r.isNull(u)?null:i.unwrap(u()),0);f.length>0&&e>0&&f.attr("maxlength",e)},update:function(t,u){var f=n(t),e=r.fixInt(r.isNull(u)?null:i.unwrap(u()),0);f.length>0&&e>0&&f.attr("maxlength",e)}};i.bindingHandlers.bsCollapse={update:function(t,u){var o=n(t),e=!0,f=r.isNull(u)?null:i.unwrap(u());r.isBool(f)?e=r.isTrue(f):(f=i.toJS(f),r.isNull(f.expanded)?r.isNull(f.collapsed)||(e=r.fixBool(f.collapsed,!0)):e=!r.fixBool(f.expanded,!1));e?o.collapse("hide"):o.collapse("show")}};i.bindingHandlers.bsPopover={init:function(t,i){var f=n(t),e=i(),u;f.length>0&&(f.attr("data-toggle","popover"),u={trigger:"focus",placement:"auto top"},r.isNull(e)||(n.extend(u,e),u.trigger=r.str.isNullOrWS(u.trigger)?"focus":u.trigger),f.popover(u))}};i.bindingHandlers.bsModal={init:function(t,u,f,e,o){var h,c;let l=n(t),s=r.isNull(u)?null:i.unwrap(u());if(i.utils.domNodeDisposal.addDisposeCallback(t,function(t){try{n(t).modal("hide")}catch(i){}try{n(".modal-backdrop").remove()}catch(i){}try{n("body").removeClass("modal-open")}catch(i){}}),l.length>0){l.attr("tabindex",-1);r.str.isNullOrWS(l.attr("role"))&&l.attr("role","alertdialog");let t=l.attr("aria-label")||l.attr("aria-labelledby");if(r.str.isNullOrWS(t)){let n=l.find(".modal-title");n.length>0&&!r.str.isNullOrWS(n[0].id)&&l.attr("aria-labelledby",n[0].id)}let n={backdrop:!0,keyboard:!0,show:!1};if(r.isBool(s))n.show=s;else if(!r.isNull(s)){let u=r.fixStr(i.unwrap(s.role),null);r.str.isNullOrWS(u)||l.attr("role",u);let t=i.unwrap(s.backdrop);r.isBool(t)?n.backdrop=t:r.str.eq(t,"static",!0)&&(n.backdrop="static");n.keyboard=r.fixBool(i.unwrap(s.keyboard),!0);n.show=r.fixBool(i.unwrap(s.show),!1)}l.modal(n)}if(!r.isNull(s)){h=null;for(c in s)r.str.eq(c,"onHide",!0)&&r.isFunc(s[c])?(h=h||{},h["hide.bs.modal"]=s[c].bind(e)):r.str.eq(c,"onHidden",!0)&&r.isFunc(s[c])?(h=h||{},h["hidden.bs.modal"]=s[c].bind(e)):r.str.eq(c,"onShow",!0)&&r.isFunc(s[c])?(h=h||{},h["show.bs.modal"]=s[c].bind(e)):r.str.eq(c,"onShown",!0)&&r.isFunc(s[c])&&(h=h||{},h["shown.bs.modal"]=s[c].bind(e));h!==null&&i.applyBindingsToNode(t,{event:h},o)}},update:function(t,u){var o=n(t),f=r.isNull(u)?null:i.unwrap(u()),e=!1;r.isBool(f)?e=r.isTrue(f):(f=i.toJS(f),e=r.isTrue(f.show));e?(o.modal("show"),t.ariaHidden=!1):(o.modal("hide"),t.ariaHidden=!0)}};i.bindingHandlers.textbox={init:function(n,t,u,f,e){var o=t(),s,h;if(r.isNull(o))throw r.ex.ArgNull("'textbox' binding options","od.ko.js");i.isSubscribable(o)?i.applyBindingsToNode(n,{textInput:o,idFor:o},e):r.isStr(o)||r.isNum(o)?i.applyBindingsToNode(n,{textInput:o},e):(s={},h=!1,r.isNull(o.value)||(s.textInput=o.value,r.isNull(o.idFor)&&r.str.isNullEmpty(n.id)&&(s.idFor=o.value),h=!0),r.isNull(o.idFor)||(s.idFor=o.idFor,h=!0),r.isNull(o.valOnBlur)?i.isSubscribable(o.value)&&!r.isNull(o.value.valid)&&i.isObservable(o.value.valid.IsValid)&&(s.valOnBlur=o.value,h=!0):r.isBool(o.valOnBlur)&&o.valOnBlur==!1||(i.isSubscribable(o.valOnBlur)||r.isArray(o.valOnBlur)?(s.valOnBlur=o.valOnBlur,h=!0):(s.valOnBlur=o.value,h=!0)),r.isNull(o.onEnter)||r.isNull(o.noEnter)?r.isNull(o.onEnter)?r.isNull(o.noEnter)||(s.noEnter=o.noEnter,h=!0):(s.enterKey={click:o.onEnter,enabled:!0},h=!0):(s.enterKey={click:o.onEnter,disabled:o.noEnter},h=!0),r.isNull(o.mask)||(s.mask=o.mask,h=!0),r.isNull(o.focus)||(s.focus=o.focus,h=!0),r.isNull(o.maxLen)||(s.maxLen=o.maxLen,h=!0),h&&i.applyBindingsToNode(n,s,e))}};i.bindingHandlers.datebox={init:function(n,t,u,f,e){var o=t();if(r.isNull(o))throw r.ex.ArgNull("'datebox' binding options","od.ko.js");i.applyBindingsToNode(n,{textbox:o},e)}};i.bindingHandlers.dropdown={init:function(n,t,u,f,e){var o=t(),s,h;if(r.isNull(o))throw r.ex.ArgNull('"dropdown" binding options',"od.ko.js");i.isSubscribable(o)?i.applyBindingsToNode(n,{value:o,idFor:o},e):r.isStr(o)||r.isNum(o)?i.applyBindingsToNode(n,{value:o},e):(s={},h=!1,r.isNull(o.value)||(s.value=o.value,r.isNull(o.idFor)&&(s.idFor=o.value),h=!0),r.isNull(o.idFor)||(s.idFor=o.idFor,h=!0),r.isNull(o.options)||(s.options=o.options,h=!0),r.isNull(o.optionsText)&&r.isNull(o.optionText)||(s.optionsText=r.isNull(o.optionsText)?o.optionText:o.optionsText,h=!0),r.isNull(o.optionsValue)&&r.isNull(o.optionValue)||(s.optionsValue=r.isNull(o.optionsValue)?o.optionValue:o.optionsValue,h=!0),r.isNull(o.optionsCaption)&&r.isNull(o.caption)||(s.optionsCaption=r.isNull(o.optionsCaption)?o.caption:o.optionsCaption,h=!0),r.isNull(o.focus)||(s.focus=o.focus,h=!0),h&&i.applyBindingsToNode(n,s,e))}};i.bindingHandlers.enable={update:function(n,t){var r=i.utils.unwrapObservable(t());r&&n.disabled?n.removeAttribute("disabled"):r||n.disabled||(n.disabled=!0);i.bindingHandlers.css.update(n,function(){return{disabled:!r}})}};i.bindingHandlers.disable2={update:function(n,t,u,f,e){var o=r.isNull(t)?null:i.unwrap(t()),s,h;if(!r.isNull(o)){if(s={},r.isBool(o)){s.disable=o;i.applyBindingsToNode(n,s,e);return}h={disabled:o.disabled};r.arr.isEmpty(o.css)||r.arr.each(o.css,function(n){r.str.isNullOrWS(n)||r.str.eq(n,"disabled")||(h[n]=o.disabled)},!1,!1);s.disable=o.disabled;i.applyBindingsToNode(n,s,e)}}};var f=function(t,u){if(i.bindingHandlers.css.update(t,function(){return{disabled:u}}),i.bindingHandlers.disable.update(t,function(){return u}),!u&&t.disabled?(t.removeAttribute("disabled"),n(t).find("*").removeAttr("disabled")):u&&!t.disabled&&(t.disabled=!0,n(t).find("*").attr("disabled","disabled")),!r.isNull(t.children)&&t.children.length>0)for(var e=0;e<t.children.length;e++)try{f(t.children[e],u)}catch(o){}};i.bindingHandlers.disableRecursive={update:function(n,t){var u=r.isNull(t)?null:i.unwrap(t());if(!r.isNull(u)&&r.isBool(u)){f(n,u);return}}};i.virtualElements.allowedBindings.disableRecursive=!0;i.bindingHandlers.title={init:function(n,t,r,u,f){var o=t(),e={};e.attr={title:o};i.applyBindingsToNode(n,e,f)}};u.ko.isCompOrObs=function(n){return i.isComputed(n)||i.isObservable(n)};i.observable.fn.setIfNot=function(n){var t=this.peek();r.isNull(n)&&r.isNull(t)||n===t||this(n)};u.ko.ValidObservable=function(n){var t=i.observable(n);return t.valid={Tests:[],IsValid:i.observable(!1),UIEnabled:i.observable(!1)},t.valid.ShowUI=i.pureComputed(function(){var n=t.valid.UIEnabled(),i=t.valid.IsValid();return n===!0&&i===!1?!0:!1},t),t.valid.Validate=function(n,i){var u=!0,f=t.peek();return r.arr.each(t.valid.Tests,function(n){var t=n.Validate(f);if(t!==!0)return u=!1,!0},!0,!1),r.fixBool(n,!1)&&t.valid.IsValid(u),r.fixBool(i,!1)&&t.valid.UIEnabled(!0),u},t};u.ko.tests={Required:function(n,t){return{Validate:r.val.required,Message:r.fixStr(n,"required",!0),PassThru:r.fixBool(t,!1)}},NotNull:function(n){return{Validate:r.val.notNull,Message:r.fixStr(n,"required",!0),PassThru:null}},MinLength:function(n,t){return{Validate:r.val.minLength,Message:r.fixStr(n,"value to short",!0),PassThru:r.fixInt(t,0)}},MaxLength:function(n,t){return{Validate:r.val.maxLength,Message:r.fixStr(n,"value to long",!0),PassThru:r.fixInt(t,0)}},Date:function(n,t){return{Validate:r.val.date,Message:r.fixStr(n,"Invalid date",!0),PassThru:r.fixBool(t,!1)}},DateGtOrEq:function(n,t){return{Validate:r.val.dateGtOrEq,Message:r.fixStr(n,null,!0),PassThru:t}},DateLtOrEq:function(n,t){return{Validate:r.val.dateLtOrEq,Message:r.fixStr(n,null,!0),PassThru:t}},Url:function(n){return{Validate:r.val.url,Message:r.fixStr(n,"invalid URL",!0)}}}}(jQuery,window._,window.ko,window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.DropDowns={getByKey:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/Dropdown/GetByKey");return n.$http(i).post({key:t})}};t.services.DropDowns.getByKey.params=function(n){return{key:n}}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.Search={SearchCases:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/Search/SearchCases");return n.$http(i).post(t)},FormatTerms:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/Search/FormatTerms");return n.$http(i).post(t)}}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.Case={CaseSummary:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/Case/CaseSummary");return n.$http(i).get(t)}}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.Attorney={}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.User={Current:function(){var t=n.url.combine(n.settings.AppUrlFull,"/User/Current");return n.$http(t).get()}}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.AccessCode={RequestCode:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/AccessCode/RequestCode");return n.$http(i).post(t)},AddCode:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/AccessCode/AddCode");return n.$http(i).post(t)}}}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){n.isNull(t.services)&&(t.services={});t.services.MyCases={RequestCode:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/MyCases/RequestCode");return n.$http(i).post(t)},Summary:function(t){var i=n.url.combine(n.settings.AppUrlFull,"/MyCases/Summary");return n.$http(i).post(t)}}}(window.ct,window.od),typeof $=="undefined")throw"jQuery required";if(typeof _=="undefined")throw"Underscore required";if(typeof Path=="undefined")throw"PathJS required";if(typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof od.services=="undefined")throw"od.services required";if(typeof od.services.User=="undefined")throw"od.services.User required";if(function(n,t,r,u,f,e,o){e.app=new function(){var t=this;t.ob={ActiveView:u.observable(),Title:u.observable(),UserRefreshing:u.observable(!1)};t.Views=[];t.addView=function(n,i){var r={Name:n,Instance:i};return t.Views.push(r),r};t.getView=function(n){for(i=0;i<t.Views.length;i++)if(f.str.eq(t.Views[i].Name,n))return t.Views[i];return null};t.setViewInstance=function(n,r){var u,s,o,h;for(i=0;i<t.Views.length;i++)f.str.eq(t.Views[i].Name,n)||(u=t.Views[i].Instance,f.isNull(u)||f.isNull(u.ob)||f.isNull(u.ob.Visible)||u.ob.Visible.peek()===!1||u.hide());for(i=0;i<t.Views.length;i++)if(f.str.eq(t.Views[i].Name,n)){u=t.Views[i];try{f.str.eq(u.Name,"Empty")||t.refreshUser()}catch(l){}f.str.isNullOrWS(u.Instance.Title)||t.setTitle(u.Instance.Title);t.ob.ActiveView(u.Instance);u.Instance.show(r);return}u=null;s=!1;for(o in e.viewModels)if(f.str.eq(o,n,!0))try{u=t.addView(o,new e.viewModels[o]);try{f.str.eq(u.Name,"Empty")||t.refreshUser()}catch(l){}f.str.isNullOrWS(u.Instance.Title)||t.setTitle(u.Instance.Title);t.ob.ActiveView(u.Instance);u.Instance.show(r);return}catch(c){s=!1;try{console.error("od.app:setViewInstance\r\nCould not load view: "+f.fixStr(n,"null")+"\r\n"+c.message)}catch(a){}break}if(!s){for(i=0;i<t.Views.length;i++)if(f.str.eq(t.Views[i].Name,"Empty")){u=t.Views[i];t.ob.ActiveView(u.Instance);t.Views[i].Instance.show();return}u=t.addView("Empty",new e.viewModels.Empty);t.ob.ActiveView(u.Instance);u.show(r);return}h=new Error("Unable to load view '"+f.fixStr(n,"null")+"' or the Empty view.");f.pa.reportError(null,h,"setViewInstance()","od.app",null);throw h;};t.setView=function(n,i,r){var u=null;f.isTrue(r)?u=t.getViewHash(n,i):(f.isNull(i)||e.app.ViewBag.addItem("SetView_"+n,i),u="#/vw/"+n);f.url.setHash(u)};t.removeView=function(n){if(!f.str.isNullOrWS(n)&&!f.arr.isEmpty(t.Views,!1)){var i=null;f.arr.each(t.Views,function(t,r){if(!f.isNull(t)&&f.str.eq(t.Name,n,!0))return i=r,!0},!0,!1);f.isNum(i)&&i>=0&&t.Views.removeAt(i)}};t.getViewHash=function(n,t){var i={v:t},r=f.str.b64Encode(JSON.stringify(i));return"#/vw/{0}/{1}".format(n,r)};t.checkHttpFailure=function(n){var t={Redirected:!1},i=f.str.tail(f.pa.ModuleUrlFull,"/",!0);return f.isNull(n)?t:(f.isTrue(n.IsUnauthorized)?(window.location=i+"/Error/Unauthorized",t.Redirected=!0):f.isTrue(n.IsForbidden)&&(window.location=i+"/Error/Forbidden",t.Redirected=!0),t)};t.user={LoggedIn:u.observable(!1),UserID:u.observable(null),Email:u.observable(null),FullName:u.observable(null),FirstName:u.observable(null),LastName:u.observable(null),AttyRole:u.observable(!1)};let s=function(n){(f.isNull(n)||!f.isTrue(n.LoggedIn))&&(n={});t.user.LastName(f.fixStr(n.LastName,null));t.user.FirstName(f.fixStr(n.FirstName,null));t.user.FullName(f.fixStr(n.FullName,null));t.user.Email(f.fixStr(n.Email,null));t.user.UserID(f.fixInt(n.UserID,null));t.user.LoggedIn(f.fixBool(n.LoggedIn,!1));t.user.AttyRole(f.fixBool(n.AttyRole,!1))};t.currentUser=function(){return u.toJS(t.user)};t.refreshUser=function(){try{if(f.isTrue(t.ob.UserRefreshing.peek()))return;t.ob.UserRefreshing(!0);e.services.User.Current().success(function(n){t.ob.UserRefreshing(!1);s(f.isNull(n)?null:n.Result)}).failure(function(n){t.ob.UserRefreshing(!1);f.pa.reportError(null,n.ErrorThrown,"userRefresh()","od.app",n);s(null)})}catch(n){t.ob.UserRefreshing(!1);f.pa.reportError(null,n,"userRefresh()","od.app",n);s(null)}};t.init=function(n,t,i,o){if(f.settings.AjaxTimeoutMS=12e4,f.settings.AppUrlFull=f.pa.ModuleUrlFull,f.settings.AppUrlRel=f.str.tail(f.pa.ModuleUrlRel,"/"),e.initLinks(f.pa.ModuleUrlFull,f.pa.LoginUrlFull,f.pa.LogoutUrlFull,f.pa.RegisterUrlFull),e.settings.SupportEmail=f.fixStr(i,"MyCaseHelp@courts.in.gov",!0),f.isNull(o)||(e.settings.AccessCodes=o),e.settings.TemplateRoot=f.url.combine(f.pa.ModuleUrlFull,"/MVVM/ViewModels"),u.virtualElements.allowedBindings.html=!0,infuser.defaults.templateSuffix=".tmpl.html",infuser.defaults.templateUrl=e.settings.TemplateRoot,f.str.isNullOrWS(window.location.hash)){e.app.setViewInstance("Empty");let n=f.fixStr(t,"Search");e.app.setView(n,f.str.eq(n,"Search",!0)?{NewSearch:!0}:null)}u.applyBindings(e.app,document.getElementById(f.fixStr(n,"OD_BODY")));r.listen()};t.scrollToTop=function(){n("html, body").animate({scrollTop:n("body").offset().top},250)};t.scrollToID=function(t){n("html, body").animate({scrollTop:n("#"+t).offset().top},250)};t.setTitle=function(n){if(!f.str.isNullOrWS(n))try{var i=f.str.fix(f.pa.ModuleName,null),r=f.isNull(i)?n:n+" - "+i;t.ob.Title(r);document.title=r}catch(u){}};r.map("#/vw/:view").to(function(){var n=this.params.view,i=null,r=e.app.ViewBag.getItem("SetView_"+n,!0);f.isNull(r)||(i=r);t.setViewInstance(n,i)});r.map("#/vw/:view(/:data)").to(function(){var r=this.params.view,n=this.params.data,i=o;f.isStr(n)&&(i=JSON.parse(f.str.b64Decode(n)).v);t.setViewInstance(r,i)});r.map("#/qs/:view").to(function(){var n=this.params.view,i=f.url.parseQuery();t.setViewInstance(n,i)});r.map("#").to(function(){t.setViewInstance("Search",null)});t.lang={genError:"An error occurred. Please try again in a few minutes."}}}($,_,Path,window.ko,window.ct,window.od),typeof $=="undefined")throw"jQuery required";if(typeof _=="undefined")throw"Underscore required";if(typeof Path=="undefined")throw"PathJS required";if(typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof od.app=="undefined")throw"od.app required";if(function(n,t){t.app.ViewBag=new function(){var t=this,i,r;t.Data=[];i=function(t){return!n.str.isNullOrWS(t)};r=function(t){return n.str.trim(t.toLowerCase())};t.addItem=function(u,f){if(!i(u))return null;n.isNull(t.Data)&&(t.Data=[]);var e=r(u);n.isNull(f)?t.removeItem(u):t.Data[e]=f};t.setItem=function(n,i){return t.addItem(n,i)};t.getItem=function(u,f){if(!i(u))return null;if(n.isNull(t.Data))return t.Data=[],null;var e=null,o=r(u),s=n.fixBool(f,!0);try{e=t.Data[o]}catch(h){e=null}return n.isUndef(e)?null:(s&&t.removeItem(o),e)};t.removeItem=function(u){if(!i(u))return!1;if(n.isNull(t.Data))return t.Data=[],!0;try{var f=r(u);return n.isUndef(t.Data[f])||delete t.Data[f],!0}catch(e){}return!1}}}(window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.ko=="undefined")throw"od.ko required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.ModelBase=function(n,r,u){var f=this;f.ViewName=t.fixStr(n,null,!0);f.Title=t.fixStr(r,null,!0);f.TemplateURL=t.fixStr(u,"",!0);f.TemplateURL.isEmptyOrWS()?f.TemplateURL=null:t.str.startsWith(f.TemplateURL,"~",!0)?f.TemplateURL=t.url.combine(i.settings.TemplateRoot,t.str.trimStart(f.TemplateURL,"~",!0)):t.str.indexOf(f.TemplateURL,"http",!0)<0&&(f.TemplateURL=t.url.combine(i.settings.TemplateRoot,f.TemplateURL));f.ob={};f.subs={};f.comp={};f.form={};f.init=function(){return}};i.viewModels.ModelBase.prototype.dispose=function(){var n;try{if(!t.isNull(this.subs))for(n in this.subs)if(!t.isNull(this.subs[n])&&t.isFunc(this.subs[n].dispose))try{i.ko.isCompOrObs(this.subs[n])?this.subs[n].dispose.bind(this.subs[n]):this.subs[n].dispose()}catch(r){}if(!t.isNull(this.comp))for(n in this.comp)if(!t.isNull(this.comp[n])&&t.isFunc(this.comp[n].dispose))try{i.ko.isCompOrObs(this.comp[n])?this.comp[n].dispose.bind(this.comp[n]):this.comp[n].dispose()}catch(r){}if(!t.isNull(this.form))for(n in this.form)if(!t.isNull(this.form[n])&&t.isFunc(this.form[n].dispose))try{i.ko.isCompOrObs(this.form[n])?this.form[n].dispose.bind(this.form[n]):this.form[n].dispose()}catch(r){}if(!t.isNull(this.ob))for(n in this.ob)if(!t.isNull(this.ob[n])&&t.isFunc(this.ob[n].dispose))try{i.ko.isCompOrObs(this.ob[n])?this.ob[n].dispose.bind(this.ob[n]):this.ob[n].dispose()}catch(r){}if(!t.isNull(this.Captcha))for(n in this.Captcha)if(!t.isNull(this.Captcha[n])&&t.isFunc(this.Captcha[n].dispose))try{i.ko.isCompOrObs(this.Captcha[n])?this.Captcha[n].dispose.bind(this.Captcha[n]):this.Captcha[n].dispose()}catch(r){}if(!t.isNull(this.MsgBox)&&t.isFunc(this.MsgBox.dispose))try{this.MsgBox.dispose()}catch(u){}}catch(u){}try{for(n in this)if(!t.isNull(this[n])&&t.isFunc(this[n].dispose))try{i.ko.isCompOrObs(this[n])?this[n].dispose.bind(this[n]):this[n].dispose()}catch(r){}}catch(u){}try{this.disposed=!0}catch(u){}}}(window.ko,window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){t.viewModels.Empty=function(){t.viewModels.ModelBase.call(this,"Empty",null,"~/Empty");var n=this;n.ob={Visible:ko.observable(!1)};n.show=function(){n.ob.Visible(!0)};n.hide=function(){n.ob.Visible(!1)}};t.viewModels.Empty.prototype=Object.create(t.viewModels.ModelBase.prototype);t.viewModels.Empty.prototype.constructor=t.viewModels.Empty}(window.ct,window.od),typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t){t.viewModels.Errors=function(){t.viewModels.ModelBase.call(this,"Errors",null,"~/Errors");var i=this;i.ob={Errors:ko.observableArray([])};i.comp={HasErrors:ko.pureComputed(function(){var t=i.ob.Errors();return!n.arr.isEmpty(t,!1)},i,{deferEvaluation:!0})};i.addError=function(t,r){var u=i.ob.Errors.peek();u.push({ID:n.utility.guid.RandStr(10),Message:t,Link:r});i.ob.Errors(u)};i.clearErrors=function(){i.ob.Errors([])};i.removeClick=function(t,r){var e=arguments,u=i.ob.Errors.peek(),f=!1;return n.arr.each(u,function(i,r){if(n.str.eq(i.ID,t.ID,!0))return u.removeAt(r),f=!0,!0},!0,!1),f&&i.ob.Errors(u),n.stopEvent(r)}};t.viewModels.Errors.prototype=Object.create(t.viewModels.ModelBase.prototype);t.viewModels.Errors.prototype.constructor=t.viewModels.Errors}(window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.Captcha=function(r){i.viewModels.ModelBase.call(this,"Captcha","Captcha Prompt","~/Captcha");var u=this;u.callback=function(){};u.Show=n.observable(!1);u.Key=n.observable(null);u.Url=n.observable(null);u.Answer=n.observable(null);u.Refresh=n.observable(!1);u.Error=n.observable(null);u.shown=function(n,t){$(t.target).find("#captchaAnswer").focus()};u.hidden=function(n){var i=t.fixBool(n.Refresh(),!1),r=t.fixStr(n.Answer(),"",!0);i||!t.str.isNullOrWS(r)?n.callback(i,r):n.Show(!0)};u.apply=function(n,i){t.stopEvent(i);u.Show(!1)};u.refresh=function(n,i){t.stopEvent(i);u.Refresh(!0);u.Show(!1)};u.reset=function(){u.Key(null);u.Url(null);u.Answer(null);u.Refresh(!1);u.Error(null)};u.init=function(){return};u.init(r)};i.viewModels.Captcha.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.Captcha.prototype.constructor=i.viewModels.Captcha}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.MsgBox=function(r){i.viewModels.ModelBase.call(this,"MsgBox","Message","~/Shared");let u=this;u.types={success:"success",warning:"warning",error:"danger",danger:"danger",info:"info",def:"info"};let f=function(n){let i=u.types;return n=t.fixStr(n,i.info,!0).toLowerCase(),t.str.eqAny(n,[i.success,i.info,i.warning,i.error])?n:i.info};u.ob={body:n.observable(null),type:n.observable(u.types.def),backdrop:n.observable(!0),keyboard:n.observable(!0),visible:n.observable(!1)};u.comp={contentCSS:n.pureComputed(function(){let n=u.ob.type();return f(n)},u,{deferEvaluation:!0})};u.success=function(n,t,i){u.show(n,u.types.success,t,i)};u.info=function(n,t,i){u.show(n,u.types.info,t,i)};u.warning=function(n,t,i){u.show(n,u.types.warning,t,i)};u.error=function(n,t,i){u.show(n,u.types.danger,t,i)};u.show=function(n,i,r,f){u.hide(u);u.ob.body(t.fixStr(n,null,!0));u.ob.type(t.fixStr(i,u.types.info,!0));u.ob.backdrop(t.fixBool(r)===!0?"static":!0);u.ob.keyboard(t.fixBool(f,!0));u.ob.visible(!0)};u.hide=function(n){n.ob.visible()===!0&&(n.ob.visible(!1),n.ob.body(null),n.ob.type(u.types.def),n.ob.backdrop(!0),n.ob.keyboard(!0))};u.init=function(){return};u.init(r)};i.viewModels.MsgBox.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.MsgBox.prototype.constructor=i.viewModels.MsgBox}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.DropDowns=="undefined")throw"od.services.DropDowns required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.Search=function(r){var u,e,o;i.viewModels.ModelBase.call(this,"Search","Case Search","~/Search");u=this;let f={Case:"ByCase",Party:"ByParty",Atty:"ByAttorney"};u.ByKeys=f;e={Mode:"Search_Mode",Adv:"Search_Adv"};u.static={FormIn:null,DefLocation:400,DefCourtItemID:null,DefSearchBy:t.storage.localGet(e.Mode,f.Case),DefAdvanced:t.storage.localGet(e.Adv,!1),DefActiveFlag:i.enums.ActiveFlag.All};u.ob={Visible:n.observable(!1),Loading:n.observable(!1),Courts:n.observableArray([]),AllCourts:n.observableArray([]),AplCourts:n.observableArray([])};u.Categories=new i.viewModels.Search.CategoriesModel;u.Limits=new i.viewModels.Search.LimitsModel;u.form={Mode:n.observable(u.static.DefSearchBy),CaseNum:n.observable(null),CiteNum:n.observable(null),CrossRefNum:n.observable(null),First:n.observable(null),Middle:n.observable(null),Last:n.observable(null),Business:n.observable(null),DoBStart:n.observable(null),DoBEnd:n.observable(null),OANum:n.observable(null),BarNum:n.observable(null),SoundEx:n.observable(!1),CourtItemID:n.observable(u.static.DefCourtItemID),Categories:n.observableArray(null),Limits:n.observableArray(null),Advanced:n.observable(u.static.DefAdvanced),ActiveFlag:n.observable(u.static.DefActiveFlag),FileStart:n.observable(null),FileEnd:n.observable(null),CountyCode:n.observable(null)};u.comp={SearchByTmpl:n.pureComputed(function(){var n=u.form.Mode();return"tmpl"+t.fixStr(n,u.static.DefSearchBy,!0)},u,{deferEvaluation:!0}),ShowSoundEx:n.pureComputed(function(){var n=u.form.Mode();return t.str.eqAny(n,["ByParty","ByAttorney"],!0)},u,{deferEvaluation:!0}),SubmitDisabled:n.pureComputed(function(){var n=u.ob.Loading();return n===!0},u,{deferEvaluation:!0}),TabLabel:n.pureComputed(function(){let n=t.fixStr(u.form.Mode(),f.Case);return"tab"+(n===f.Atty?f.Atty:n===f.Party?f.Party:f.Case)},u,{deferEvaluation:!0})};u.subs={Advanced:u.form.Advanced.subscribe(function(n){t.storage.localSet(e.Adv,t.fixBool(n,!1))},u),Mode:u.form.Mode.subscribe(function(n){t.storage.localSet(e.Mode,t.fixStr(n,f.Case));u.resetSimple(n)},u),CourtItemID:u.form.CourtItemID.subscribe(function(n){if(!t.isNull(n)){var i=t.arr.firstMatch(u.ob.Courts.peek(),"ID",n);t.isNull(i)||i.Appellate!==!0&&i.Commercial!=!0||u.form.Categories(["CV"]);t.isNull(i)||(u.Categories.showKeys(i.CategoryKeys,!0),u.Limits.showKeys(i.LimitKeys,!0),u.Limits.uncheckAll(),(i.Appellate===!0||i.Commercial==!0)&&u.form.Categories(["CV"]))}},u),Limits:u.Limits.selectedKeys.subscribe(function(n){t.arr.isEmpty(n)?t.isNull(u.form.Limits.peek())||u.form.Limits(null):u.form.Limits(n);u.Categories.limitsSet(n)},u),Categories:u.Categories.selectedKeys.subscribe(function(n){if(t.arr.isEmpty(n)){var i=t.arr.firstMatch(u.ob.Courts.peek(),"ID",u.form.CourtItemID());t.isNull(i)||i.Appellate!==!0&&i.Commercial!=!0?u.form.Categories(null):u.form.Categories(["CV"])}else u.form.Categories(n)},u)};u.getTabID=function(n){return"tab"+n};u.modeClick=function(n,i,r){return t.stopEvent(r),u.form.Mode(n===f.Atty?f.Atty:n===f.Party?f.Party:f.Case),!1};u.advancedClick=function(n,i){var r=u.form.Advanced.peek();return u.form.Advanced(!r),t.stopEvent(i)};u.searchClick=function(n,i){t.stopEvent(i);try{$(i.currentTarget).change()}catch(r){}if(t.isTrue(u.ob.Loading.peek()))return!1;u.searchClickContinue()};u.searchClickContinue=function(){if(t.isTrue(u.ob.Loading.peek()))return!1;var r=n.toJS(u.form);return t.pa.notify.clear(),u.validateCriteria(r)===!0&&(i.app.ViewBag.addItem("Results_Reset",!0),i.app.setView("SearchResults",r,!0)),!1};u.validateCriteria=function(n){var i=!1,e,r,o,s;try{i=t.fixBool(u.Limits.Items.COM.checked.peek(),!1);i||(e=t.arr.firstMatch(u.ob.Courts.peek(),"ID",u.form.CourtItemID.peek()),i=!t.isNull(e)&&e.Commercial===!0)}catch(h){i=!1}if(t.str.eq(n.Mode,f.Party,!0)){if(t.str.isNullOrWS(n.Last)&&t.str.isNullOrWS(n.First)&&t.str.isNullOrWS(n.Middle)&&t.str.isNullOrWS(n.Business)&&t.str.isNullOrWS(n.DoBStart)&&!i)return t.pa.notify.warning("Please enter a value for searching by a Person or Business.",null),!1;if(!t.str.isNullOrWS(n.DoBStart)&&t.str.isNullOrWS(n.Last)&&!i)return t.pa.notify.warning("Please enter a value for Last Name when searching by Date of Birth.",null),!1;if(!t.str.isNullOrWS(n.Last)&&!t.str.isNullOrWS(n.Business)&&!i)return t.pa.notify.warning("Please enter a value for either Last Name or Business, but not both.",null),!1;if(!t.str.isNullOrWS(n.First)&&t.str.isNullOrWS(n.Last))return t.pa.notify.warning("Please enter a Last Name when searching by First Name",null),!1;if(!t.str.isNullOrWS(n.Middle)&&t.str.isNullOrWS(n.Last))return t.pa.notify.warning("Please enter a Last Name when searching by Middle Name",null),!1;if(!t.str.isNullOrWS(n.Last)&&n.Last.indexOf("*")>=0&&(n.Last.indexOf("*")!=n.Last.length-1||n.Last.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Last Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.First)&&n.First.indexOf("*")>=0&&(n.First.indexOf("*")!=n.First.length-1||n.First.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the First Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.Middle)&&n.Middle.indexOf("*")>=0&&(n.Middle.indexOf("*")!=n.Middle.length-1||n.Middle.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Middle Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.Business)&&n.Business.indexOf("*")>=0&&(n.Business.indexOf("*")!=n.Business.length-1||n.Business.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Business Name field and the value must start with a letter or number.",null),!1}else if(t.str.eq(n.Mode,f.Atty,!0)){if(t.str.isNullOrWS(n.Last)&&t.str.isNullOrWS(n.BarNum)&&t.str.isNullOrWS(n.First)&&t.str.isNullOrWS(n.Middle)&&!i)return t.pa.notify.warning("Please enter a value for searching by Attorney Name or Attorney Number.",null),!1;if(!(t.str.isNullOrWS(n.Last)&&t.str.isNullOrWS(n.First)&&t.str.isNullOrWS(n.Middle))&&!t.str.isNullOrWS(n.BarNum))return t.pa.notify.warning("Please use either Name Fields or the Attorney Number field, but not both",null),!1;if(!(t.str.isNullOrWS(n.First)&&t.str.isNullOrWS(n.Middle))&&t.str.isNullOrWS(n.Last))return t.pa.notify.warning("Please enter a value for Last Name when searching by First or Middle Name.",null),!1;if(!t.str.isNullOrWS(n.Last)&&n.Last.indexOf("*")>=0&&(n.Last.indexOf("*")!=n.Last.length-1||n.Last.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Last Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.First)&&n.First.indexOf("*")>=0&&(n.First.indexOf("*")!=n.First.length-1||n.First.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the First Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.Middle)&&n.Middle.indexOf("*")>=0&&(n.Middle.indexOf("*")!=n.Middle.length-1||n.Middle.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Middle Name field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.BarNum)&&n.BarNum.indexOf("*")>=0&&(n.BarNum.indexOf("*")!=n.BarNum.length-1||n.BarNum.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Atty/Bar Number field and the value must start with a letter or number.",null),!1}else if(t.str.eq(n.Mode,f.Case,!0)){if(r=0,r+=t.str.isNullOrWS(n.CaseNum)?0:1,r+=t.str.isNullOrWS(n.CiteNum)?0:1,r+=t.str.isNullOrWS(n.CrossRefNum)?0:1,r==0&&!i)return t.pa.notify.warning("Please enter a value for Case, Citation, or Cross Reference number."),!1;if(r>1)return t.pa.notify.warning("Please enter only one value for either Case, Citation, or Cross Reference number.",null),!1;if(!t.str.isNullOrWS(n.CaseNum)&&n.CaseNum.indexOf("*")>=0&&(n.CaseNum.indexOf("*")!=n.CaseNum.length-1||n.CaseNum.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Case Number field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.CiteNum)&&n.CiteNum.indexOf("*")>=0&&(n.CiteNum.indexOf("*")!=n.CiteNum.length-1||n.CiteNum.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Citation Number field and the value must start with a letter or number.",null),!1;if(!t.str.isNullOrWS(n.CrossRefNum)&&n.CrossRefNum.indexOf("*")>=0&&(n.CrossRefNum.indexOf("*")!=n.CrossRefNum.length-1||n.CrossRefNum.indexOf("*")==0))return t.pa.notify.warning("You can only use a wild-card search at the end of the Cross Reference field and the value must start with a letter or number.",null),!1}return!t.str.isNullOrWS(n.FileStart)&&!t.str.isNullOrWS(n.FileEnd)&&(o=new Date(n.FileStart),s=new Date(n.FileEnd),s<o)?(t.pa.notify.warning("Start Date must be occur before End Date",null),!1):!0};u.getCourtItems=function(){try{u.ob.Loading(!0);i.services.DropDowns.getByKey(i.enums.Dropdowns.CourtItems).success(function(n){var e;if(u.ob.Loading(!1),t.arr.isEmpty(n.Result))u.resetCourts();else{var i=null,f=[],r=[];t.arr.each(n.Result,function(n){!t.isNull(n)&&t.isNum(n.ID)&&n.ID>0&&(t.isTrue(n.Default)&&(i=n.ID),t.isTrue(n.Appellate)&&f.push(n),r.push(n))});t.arr.isEmpty(r)?(u.ob.AllCourts([]),u.ob.Courts([])):(u.ob.AllCourts(r),u.ob.Courts(r));t.arr.isEmpty(f)?u.ob.AplCourts([]):u.ob.AplCourts(f);t.isNull(i)&&(i=n.Result[0].ID);e=!t.isNull(u.static.FormIn)&&t.isNum(u.static.FormIn.CourtItemID)?u.static.FormIn.CourtItemID:i;u.static.DefCourtItemID=e||null;u.form.CourtItemID(e)}}).failure(function(n){t.pa.reportError(t.pa.errorMsg.PageLoad,null,"Error while calling od.services.DropDowns.getByKey","Search.js",n);u.ob.Loading(!1);u.resetCourts()})}catch(n){t.pa.reportError(t.pa.errorMsg.PageLoad,n,"Error while calling od.services.DropDowns.getByKey","Search.js");u.ob.Loading(!1);u.resetCourts()}};u.resetCourts=function(){u.form.CourtItemID(null);u.ob.Courts([]);u.ob.AplCourts([]);u.ob.AllCourts([])};u.resetSimple=function(n){t.str.eq(n,f.Case)||(u.form.CaseNum(null),u.form.CiteNum(null),u.form.CrossRefNum(null));t.str.eqAny(n,[f.Party,f.Atty])||(u.form.First(null),u.form.Middle(null),u.form.Last(null),u.form.Business(null));t.str.eqAny(n,f.Party)||(u.form.DoBEnd(null),u.form.DoBStart(null),u.form.OANum(null));t.str.eq(n,f.Atty)||u.form.BarNum(null)};u.resetForm=function(){u.form.Mode(t.storage.localGet(e.Mode,u.static.DefSearchBy));u.form.CaseNum(null);u.form.CiteNum(null);u.form.CrossRefNum(null);u.form.First(null);u.form.Last(null);u.form.Middle(null);u.form.Business(null);u.form.DoBStart(null);u.form.DoBEnd(null);u.form.OANum(null);u.form.BarNum(null);u.form.SoundEx(!1);u.form.CourtItemID(u.static.DefCourtItemID);u.Categories.uncheckAll();u.Limits.uncheckAll();u.form.Categories(null);u.form.Limits(null);u.form.ActiveFlag(u.static.DefActiveFlag);u.form.FileStart(null);u.form.FileEnd(null);u.form.CountyCode(null);t.pa.notify.clear()};u.parseFormIn=function(){var n=u.static.FormIn;if(t.isNull(n)){u.resetSimple(u.static.DefSearchBy);return}u.form.Mode(n.Mode);u.form.CourtItemID(n.CourtItemID);u.Categories.checkKeys(n.Categories);u.Limits.checkKeys(n.Limits);u.form.ActiveFlag(n.ActiveFlag);u.form.SoundEx(n.SoundEx);u.form.CountyCode(n.CountyCode);u.form.CaseNum(n.CaseNum);u.form.CiteNum(n.CiteNum);u.form.CrossRefNum(n.CrossRefNum);u.form.FileEnd(n.FileEnd);u.form.FileStart(n.FileStart);u.form.First(n.First);u.form.Last(n.Last);u.form.Middle(n.Middle);u.form.Business(n.Business);u.form.DoBEnd(n.DoBEnd);u.form.DoBStart(n.DoBStart);u.form.BarNum(n.BarNum);u.form.OANum(n.OANum);u.form.Advanced(t.fixBool(n.Advanced,u.static.DefAdvanced))};u.hide=function(){u.ob.Visible(!1);t.pa.notify.clear(!1)};u.show=function(n){t.isNull(n)||(t.isTrue(n.NewSearch)||t.isTrue(i.app.ViewBag.getItem("Search_New")))&&(u.static.FormIn=null,u.resetForm());i.app.scrollToTop();u.ob.Visible(!0);t.arr.isEmpty(u.ob.Courts.peek())&&u.getCourtItems()};u.init=function(n){u.resetForm();t.isNull(n)?u.static.FormIn=null:(u.static.FormIn=n,u.parseFormIn())};o=u.dispose;u.dispose=function(){try{try{!t.isNull(u.Categories)&&t.isFunc(u.Categories.dispose)&&u.Categories.dispose()}catch(n){}try{!t.isNull(u.Limits)&&t.isFunc(u.Limits.dispose)&&u.Limits.dispose()}catch(n){}try{t.isFunc(o)&&o.apply(this)}catch(n){}}catch(i){}};u.init(r)};i.viewModels.Search.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.Search.prototype.constructor=i.viewModels.Search;i.viewModels.Search.LimitsModel=function(){var i=this;i.Items={APL:{title:"Appellate",checked:n.observable(),disabled:n.observable(!1),hidden:n.observable(!1)},COM:{title:"Commercial",checked:n.observable(),disabled:n.observable(!1),hidden:n.observable(!1)}};i.keys=function(){var n=[];for(var t in i.Items)n.add(t);return n};i.show=function(n,r){if(!t.str.isNullOrWS(n)){var f=!t.fixBool(r,!0),u=i.Items[n.trim().toUpperCase()];t.isNull(u)||u.hidden(f)}};i.showKeys=function(n,r){var f=t.isNull(r)?null:t.fixBool(r,!0),u=[];t.arr.each(n,function(n){t.str.isNullOrWS(n)||u.push(n.trim().toUpperCase())});t.arr.each(i.keys(),function(n){u.indexOf(n)>-1?i.Items[n].hidden(!1):t.isTrue(f)&&i.Items[n].hidden(!0)})};i.uncheckAll=function(){for(var n in i.Items)i.Items[n].checked(!1)};i.checkKeys=function(n,r){var f=t.isNull(r)?null:t.fixBool(r,!0),u=[];t.arr.each(n,function(n){t.str.isNullOrWS(n)||u.push(n.trim().toUpperCase())});t.arr.each(i.keys(),function(n){u.indexOf(n)>-1?i.Items[n].checked(!0):t.isTrue(f)&&i.Items[n].checked(!1)})};i.anyVisible=n.computed(function(){for(var n in i.Items)if(!i.Items[n].hidden())return!0;return!1},i,{deferEvaluation:!0});i.anyChecked=n.computed(function(){for(var n in i.Items)if(i.Items[n].checked())return!0;return!1},i,{deferEvaluation:!0});i.selectedKeys=n.computed(function(){var n=[],r,u;for(r in i.Items)u=i.Items[r],u.checked()&&!u.hidden()&&n.push(r);return t.arr.isEmpty(n)?null:n},i,{deferEvaluation:!0});i.Items.APL.checked.subscribe(function(n){n===!0?(i.Items.COM.checked(!1),i.Items.COM.disabled(!0)):i.Items.COM.disabled(!1)},i);i.Items.COM.checked.subscribe(function(n){n===!0?(i.Items.APL.checked(!1),i.Items.APL.disabled(!0)):i.Items.APL.disabled(!1)},i);i.dispose=function(){try{try{!t.isNull(i.anyVisible)&&t.isFunc(i.anyVisible.dispose)&&i.anyVisible.dispose()}catch(n){}try{!t.isNull(i.selectedKeys)&&t.isFunc(i.selectedKeys.dispose)&&i.selectedKeys.dispose()}catch(n){}}catch(r){}}};i.viewModels.Search.CategoriesModel=function(){var i=this;i.Hidden=n.observable(!1);i.Items={CR:{title:"Criminal & Citation",checked:n.observable(!1),disabled:n.observable(!1),hidden:n.observable(!1)},CV:{title:"Civil",checked:n.observable(!1),disabled:n.observable(!1),hidden:n.observable(!1)},FAM:{title:"Family",checked:n.observable(!1),disabled:n.observable(!1),hidden:n.observable(!1)},PR:{title:"Probate",checked:n.observable(!1),disabled:n.observable(!1),hidden:n.observable(!1)}};i.keys=function(){var n=[];for(var t in i.Items)n.add(t);return n};i.checkAll=function(){for(var n in i.Items)i.Items[n].checked(!0)};i.uncheckAll=function(){for(var n in i.Items)i.Items[n].checked(!1)};i.checkKeys=function(n,r){var f=t.isNull(r)?null:t.fixBool(r,!0),u=[];t.arr.each(n,function(n){t.str.isNullOrWS(n)||u.push(n.trim().toUpperCase())});t.arr.each(i.keys(),function(n){u.indexOf(n)>-1?i.Items[n].checked(!0):t.isTrue(f)&&i.Items[n].checked(!1)})};i.show=function(n,r){if(!t.str.isNullOrWS(n)){var f=!t.fixBool(r,!0),u=i.Items[n.trim().toUpperCase()];t.isNull(u)||u.hidden(f)}};i.showKeys=function(n,r){var f=t.isNull(r)?null:t.fixBool(r,!0),u=[];t.arr.each(n,function(n){t.str.isNullOrWS(n)||u.push(n.trim().toUpperCase())});t.arr.each(i.keys(),function(n){u.indexOf(n)>-1?i.show(n,!0):t.isTrue(f)&&i.show(n,!1)})};i.limitsSet=function(n){var r=!t.arr.isEmpty(n);t.arr.each(i.keys(),function(n){var t=i.Items[n];t.disabled(r);t.checked(!1)})};i.selectedKeys=n.computed(function(){var r=[],n,t;for(n in i.Items)t=i.Items[n],t.checked()&&!t.hidden()&&r.push(n);return r},i,{deferEvaluation:!1});i.anyVisible=n.computed(function(){if(i.Hidden())return!1;for(var n in i.Items)if(!i.Items[n].hidden())return!0;return!1},i,{deferEvaluation:!0});i.dispose=function(){try{try{!t.isNull(i.anyVisible)&&t.isFunc(i.anyVisible.dispose)&&i.anyVisible.dispose()}catch(n){}try{!t.isNull(i.selectedKeys)&&t.isFunc(i.selectedKeys.dispose)&&i.selectedKeys.dispose()}catch(n){}}catch(r){}}}}(window.ko,window.ct,window.od),typeof jQuery=="undefined")throw"jQuery required";if(typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.Search=="undefined")throw"od.services.Search required";if(function(n,t,i,r){i.isNull(r.viewModels)&&(r.viewModels={});r.viewModels.SearchResults=function(u){var f,e;r.viewModels.ModelBase.call(this,"SearchResults","Results","~/SearchResults");f=this;f.Terms=new r.viewModels.SearchResults.Terms;e={ShowDet:"Results_ShowDetails",SortBy:"Results_SortBy",SortDir:"Results_SortDir",TableMode:"Results_TableMode"};f.sorts=Object.assign({},r.CaseSorts);f.static={FormIn:null,DefShowDetails:i.storage.localGet(e.ShowDet,!0),DefSortBy:i.storage.sessionGet(e.SortBy,"FileDate"),DefSortDir:i.storage.sessionGet(e.SortDir,"DESC"),DefSkip:0,DefTake:20,DefTableMode:i.storage.localGet(e.TableMode,!1)};f.Errors=new r.viewModels.Errors;f.dpager=new r.viewModels.SearchResults.ResultsPager;f.dpager.onPageChanged=function(){f.doSearch(f.static.FormIn,!0)};f.ob={Visible:t.observable(!1),Searching:t.observable(!1),Paging:t.observable(!1),Results:t.observableArray(null),ShowAllDetails:t.observable(f.static.DefShowDetails),ShowSort:t.observable(!1),TableMode:t.observable(f.static.DefTableMode),ResultsMaxxed:t.observable(!1)};f.Captcha=new r.viewModels.Captcha;f.form={SortBy:t.observable(f.static.DefSortBy),SortByChoice:t.observable(f.static.DefSortBy),SortDir:t.observable(f.static.DefSortDir),SortDirChoice:t.observable(f.static.DefSortDir),Skip:t.observable(f.static.DefSkip),Take:t.observable(f.static.DefTake)};f.comp={ShowSearching:t.computed(function(){return f.ob.Searching()},f),ShowResults:t.computed(function(){var n=f.ob.Searching();return n===!0?!1:!0},f),ShowNoResults:t.computed(function(){var n=f.ob.Searching(),t=f.ob.Paging(),i=f.dpager.Total();return n===!1&&t===!1&&i<1?!0:!1},f),ShowPaging:t.computed(function(){var n=f.ob.Searching(),t=f.dpager.Total(),i=f.dpager.Take();return n===!0||t<=i?!1:!0},f,{deferEvaluation:!0}),ShowBottomToolbar:t.computed(function(){var n=f.ob.Searching(),t=f.ob.Paging(),i=f.dpager.Total();return i>=8&&!n&&!t},f,{deferEvaluation:!0}),DisableControls:t.pureComputed(function(){var n=f.ob.Searching(),t=f.ob.Paging();return n||t},f),CurSort:t.pureComputed(function(){var t=f.form.SortBy(),r=f.form.SortDir(),n=f.sorts.getLabel(t);return i.str.isNullOrWS(n)?"":i.str.eq(r,"DESC",!0)?n+", Descending":n+", Ascending"},f),ListViewEnabled:t.pureComputed(function(){var n=f.comp.DisableControls(),t=f.ob.TableMode();return!n&&!t},f),TableViewEnabled:t.pureComputed(function(){var n=f.comp.DisableControls(),t=f.ob.TableMode();return!n&&t},f)};f.subs={SortBy:f.form.SortBy.subscribe(function(n){i.storage.sessionSet(e.SortBy,n);f.form.SortByChoice(n)},f),SortDir:f.form.SortDir.subscribe(function(n){i.storage.sessionSet(e.SortDir,n);f.form.SortDirChoice(n)},f)};f.Captcha.callback=function(){f.doSearch(f.static.FormIn,!1)};f.sortClick=function(n,t){return f.comp.DisableControls()===!0?(i.stopEvent(t),!1):(f.ob.ShowSort(!0),!0)};f.sortApplyClick=function(n,t){i.stopEvent(t);f.ob.ShowSort(!1);var r=f.form.SortBy.peek(),u=f.form.SortDir.peek(),e=f.form.SortByChoice.peek(),o=f.form.SortDirChoice.peek();return i.str.eq(r,e,!0)&&i.str.eq(u,o,!0)||(f.dpager.Skip(0),f.form.SortBy(i.fixStr(e,r)),f.form.SortDir(i.fixStr(o,u)),f.doSearch(f.static.FormIn,!0)),!1};f.sortHidden=function(n){var t=n.ob.ShowSort();t===!0&&n.ob.ShowSort(!1)};f.resultClick=function(n,t){return(i.stopEvent(t),!i.isNum(n.CaseID)||n.CaseID<1)?!1:(r.app.ViewBag.setItem("Summary_FromResults",!0),r.app.setView("CaseSummary",{CaseToken:n.CaseToken},!0),!1)};f.toggleExpand=function(n){var t=i.fixBool(n.$expanded.peek(),!1);return n.$expanded(!t),f.ob.ShowAllDetails(!t),!0};f.toggleTableMode=function(n,t,r){try{if(f.comp.DisableControls.peek()||n==f.ob.TableMode.peek())return i.stopEvent(r),!1}catch(u){}var n=!i.fixBool(f.ob.TableMode.peek(),!0);return i.storage.localSet(e.TableMode,n),f.ob.TableMode(n),!0};f.toggleDetails=function(n,t){if(f.comp.DisableControls.peek()||f.ob.TableMode.peek())return i.stopEvent(t),!1;var s=i.fixBool(f.ob.ShowAllDetails.peek(),!1),r=!s,u=f.ob.Results.peek(),o=!1;return _.each(u,function(n){n.$expanded.peek()!=r&&(n.$expanded(r),o=!0)},this),o&&f.ob.Results(u),i.storage.localSet(e.ShowDet,r),f.ob.ShowAllDetails(r),!0};f.backClick=function(n,t){return i.stopEvent(t),window.history.back(),!1};f.newClick=function(n,t){return i.stopEvent(t),r.app.setView("Search",{NewSearch:!0}),!1};f.refineClick=function(n,t){return i.stopEvent(t),r.app.setView("Search",{NewSearch:!1}),!1};f.doSearch=function(t,u){var e;try{if(e={},n.extend(e,t),i.fixBool(u)===!0)f.ob.Paging(!0),e.NewSearch=!1,e.CaptchaAnswer=null;else{f.ob.Searching(!0);e.NewSearch=!0;var o=i.fixStr(f.Captcha.Key(),"",!0),s=i.fixStr(f.Captcha.Answer(),"",!0),h=i.fixBool(f.Captcha.Refresh(),!1);e.CaptchaAnswer=o!=""?{Key:o,Answer:s,Refresh:h}:null;f.Captcha.Refresh(!1)}e.Skip=f.dpager.Skip.peek();e.Take=f.dpager.Take.peek();e.Sort=f.form.SortBy.peek()+" "+f.form.SortDir.peek();try{delete f.static.FormIn.CA}catch(l){}r.services.Search.SearchCases(e).success(function(n){f.ob.Searching(!1);f.ob.Paging(!1);r.app.scrollToTop();f.parseResults(n.Result)}).failure(function(n){r.app.checkHttpFailure(n).Redirected||(f.ob.Searching(!1),f.ob.Paging(!1),i.pa.reportError("An error occurred while searching. Could not complete the search.",n.ErrorThrown,"SearchResults.doSearch.failure","SearchResults.js",n),r.app.scrollToTop())})}catch(c){console.error("SearchResults.doSearch\r\n"+c);f.ob.Searching(!1);f.ob.Paging(!1);r.app.scrollToTop()}};f.formatTerms=function(t,u){try{f.Terms.reset();i.fixBool(u,!1)===!0?f.ob.Paging(!0):f.ob.Searching(!0);var e={};n.extend(e,t);r.services.Search.FormatTerms(e).success(function(n){f.Terms.parse(n.Result);f.doSearch(t,u)}).failure(function(n){f.ob.Searching(!1);f.ob.Paging(!1);console.error("SearchResults.formatTerms.failure\r\n"+n.ErrorThrown);r.app.scrollToTop()})}catch(o){console.error("SearchResults.formatTerms\r\n"+o);f.ob.Searching(!1);f.ob.Paging(!1);r.app.scrollToTop()}};f.parseResults=function(n){var u,e;try{if(n.CaptchaKey)return f.Captcha.Key(n.CaptchaKey),f.Captcha.Url(n.Url),f.Captcha.Error(n.Error),f.Captcha.Answer(null),f.Captcha.Show(!0),f.ob.Searching(!0),!1;f.Captcha.reset();u=Math.max(i.fixInt(n.TotalResults,0),0);u>1e3?(u=1e3,f.ob.ResultsMaxxed(!0)):f.ob.ResultsMaxxed(!1);f.dpager.Total(u);u===0||i.arr.isEmpty(n.Results)?f.ob.Results(null):(e=f.ob.ShowAllDetails.peek(),_.each(n.Results,function(n){n.$expanded=t.observable(e);n.$uniqueID=r.ko.uniqueIDs.nextID()},this),f.ob.Results(n.Results))}catch(o){console.error("SearchResults.parseResults\r\n"+o)}};f.init=function(n){if(r.app.scrollToTop(),i.isNull(n)){f.static.FormIn=null;f.Terms.parse(null);return}if(!i.isNull(n.FormExt)){var t=n.FormExt;i.isNum(t.Skip)&&t.Skip>-1&&(f.dpager.Skip.setIfNot(t.Skip),f.form.Skip.setIfNot(t.Skip));i.isNum(t.Take)&&t.Take>0&&(f.dpager.Take.setIfNot(t.Take),f.form.Take.setIfNot(t.Take));i.str.isNullOrWS(t.SortBy)||f.form.SortBy.setIfNot(t.SortBy);i.str.isNullOrWS(t.SortDir)||f.form.SortDir.setIfNot(t.SortDir);try{delete n.FormExt}catch(u){}}f.static.FormIn=n;f.formatTerms(n,!1)};f.hide=function(){f.ob.ShowSort(!1);f.Errors.clearErrors();f.ob.Visible(!1)};f.show=function(n){if(f.ob.Visible(!0),i.isTrue(r.app.ViewBag.getItem("Results_Reset"))&&(f.ob.Results(null),f.dpager.reset(),f.form.SortBy(i.storage.sessionGet(e.SortBy,f.static.DefSortBy)),f.form.SortDir(i.storage.sessionGet(e.SortDir,f.static.DefSortDir))),!i.isNull(n)){if(i.isTrue(r.app.ViewBag.getItem("Results_NoReload"))&&!i.arr.isEmpty(f.ob.Results.peek()))return;f.init(n)}};f.init(u)};r.viewModels.SearchResults.prototype=Object.create(r.viewModels.ModelBase.prototype);r.viewModels.SearchResults.prototype.constructor=r.viewModels.SearchResults}(jQuery,window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.viewModels=="undefined")throw"od.viewModels required";if(typeof window.od.viewModels.SearchResults=="undefined")throw"od.viewModels.SearchResults required";if(function(n,t,i){i.viewModels.SearchResults.ResultsPager=function(r){var u=this;u.ButtonCount=t.fixInt(i.settings.PagerButtonsCount,5);u.DefaultTake=20;u.Total=n.observable(0);u.Skip=n.observable(0);u.Take=n.observable(u.DefaultTake);u.PageCount=n.computed(function(){var n=t.fixInt(u.Total(),0),i=t.fixInt(u.Take(),u.DefaultTake);return n>0?Math.floor(n/i)+(n%i>0?1:0):0},u);u.MultiPage=n.pureComputed(function(){var n=u.PageCount();return n>1},u);u.CurrentPage=n.pureComputed(function(){var i=t.fixInt(u.Total(),0),n=t.fixInt(u.Skip(),0),r=t.fixInt(u.Take(),u.DefaultTake);return i<=0?0:n===0?1:n>=i?u.PageCount():Math.floor(n/r)+1},u);u.HasPrevPage=n.pureComputed(function(){var n=u.CurrentPage();return n>1},u);u.HasNextPage=n.pureComputed(function(){var n=u.CurrentPage(),t=u.PageCount();return isNaN(n)||n>=t?!1:!0},u);u.PageButtons=n.computed(function(){var c=t.fixInt(u.Total(),0),l=t.fixInt(u.Skip(),0),a=t.fixInt(u.Take(),u.DefaultTake),f=u.CurrentPage(),r=u.PageCount(),e=Math.ceil(u.ButtonCount/2),i=[],s,o,h,n;if(r<=u.ButtonCount){for(n=1;n<=r;n++)i.push(n);return i}if(f<=e){for(n=1;n<=u.ButtonCount;n++)i.push(n);return i}if(s=r-(u.ButtonCount-e),f>=s){for(n=r-u.ButtonCount;n<=r;n++)i.push(n);return i}for(o=f-e+1,h=o+u.ButtonCount-1,n=o;n<=h;n++)i.push(n);return i},u,{deferEvaluation:!0});u.ShowPrevNext=n.pureComputed(function(){var n=u.PageCount();return!(n<=u.ButtonCount)},u);u.NoPrev=n.pureComputed(function(){var n=u.PageCount();return n<=1?!0:!u.HasPrevPage()},u);u.NoNext=n.pureComputed(function(){var n=u.PageCount();return n<=1?!0:!u.HasNextPage()},u);u.Showing=n.pureComputed(function(){var n=t.fixInt(u.Total(),0),i=u.Take(),r=u.Skip();return n<1?"&nbsp;":n===1?"1 Result":n<=i?n+" Results":""+(t.str.fix(r+1,"0")+" to "+t.str.fix(Math.min(i+r,n),"0")+" of "+t.str.fix(n,"0"))},u);u.onPageChanged=function(){return!1};u.setPage=function(n,i){t.stopEvent(i);var f=u.CurrentPage(),o=u.PageCount(),e=u.Skip(),r=u.Take();if(t.str.eq(n,"prev",!0)){if(u.NoPrev()===!0)return!1;n=f-1}else if(t.str.eq(n,"next",!0)){if(u.NoNext()===!0)return!1;n=f+1}if(n=t.fixInt(n,1),n==f)return!1;e=n<=1?0:n>=o?o*r-r:n*r-r;u.Skip(e);u.onPageChanged(e,r);return!1};u.reset=function(){u.Total(0);u.Skip(0);u.Take(u.DefaultTake)};u.init=function(n){if(t.isNull(n)){u.reset();return}};t.isNull(r)||u.init(r)}}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.viewModels=="undefined")throw"od.viewModels required";if(typeof window.od.viewModels.SearchResults=="undefined")throw"od.viewModels.SearchResults required";if(function(n,t,i){i.viewModels.SearchResults.Terms=function(i){var r=this;r.Visible=n.observable(!1);r.ModeLabel=n.observable(null);r.ModeValue=n.observable(null);r.Court=n.observable(null);r.FileDates=n.observable(null);r.Limits=n.observable(null);r.Status=n.observable(null);r.First=n.observable(null);r.Middle=n.observable(null);r.Last=n.observable(null);r.Business=n.observable(null);r.BarNumber=n.observable(null);r.SoundEx=n.observable(null);r.DOBDates=n.observable(null);r.parse=function(n){if(t.isNull(n)||n.Hidden===!0){r.Visible(!1);r.reset();return}r.Visible(!0);r.ModeLabel(t.fixStr(n.ModeLabel,null,!0));r.ModeValue(t.fixStr(n.ModeValue,null,!0));r.Court(t.fixStr(n.Court,null,!0));r.FileDates(t.fixStr(n.FileDates,null,!0));r.Limits(t.fixStr(n.Limits,null,!0));r.Status(t.fixStr(n.Status,null,!0));r.First(t.fixStr(n.First,null,!0));r.Middle(t.fixStr(n.Middle,null,!0));r.Last(t.fixStr(n.Last,null,!0));r.Business(t.fixStr(n.Business,null,!0));r.BarNumber(t.fixStr(n.BarNumber,null,!0));r.SoundEx(t.fixStr(n.SoundEx,null,!0));r.DOBDates(t.fixStr(n.DOBDates,null,!0))};r.reset=function(){r.ModeLabel(null);r.ModeValue(null);r.Court(null);r.FileDates(null);r.Limits(null);r.Status(null);r.First(null);r.Middle(null);r.Last(null);r.Business(null);r.BarNumber(null);r.SoundEx(null);r.DOBDates(null)};t.isNull(i)||r.parse(i)}}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.Case=="undefined")throw"od.services.Case required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.CaseSummary=function(r){i.viewModels.ModelBase.call(this,"CaseSummary","Summary","~/CaseSummary");var u=this;u.static={CaseToken:null,SRCT:null,FromResults:!1};u.Errors=new i.viewModels.Errors;u.ob={Visible:n.observable(!1),Loading:n.observable(!1),Summary:n.observable(null),InvalidToken:n.observable(!1),NotFound:n.observable(!1),AccessDenied:n.observable(!1),HideToolbars:n.observable(!1),PALogo:n.observable(!1)};u.Captcha=new i.viewModels.Captcha;u.form={};u.comp={DisableControls:n.pureComputed(function(){var n=u.ob.Loading();return n===!0},u)};u.subs={};u.Captcha.callback=function(){u.getSummary(u.static.CaseToken)};u.backClick=function(n,i){return t.stopEvent(i),window.history.back(),!1};u.newClick=function(n,r){return t.stopEvent(r),i.app.setView("Search",{NewSearch:!0}),!1};u.refineClick=function(n,r){return t.stopEvent(r),i.app.setView("Search",{NewSearch:!1}),!1};u.requestAC=function(n,r){if(t.stopEvent(r),i.settings.AccessCodes.Enabled===!0){let n=u.ob.Summary();u.static.FromResults===!0&&i.app.ViewBag.setItem("Summary_FromResults",!0);i.app.setView("ACRequest",{CaseNumber:n.CaseNumber,CaseToken:u.static.CaseToken,Parties:n.ob.ACParties()})}return!1};u.getSummary=function(n,r){try{u.ob.InvalidToken(!1);u.ob.NotFound(!1);u.ob.Loading(!0);let f={SRCT:r,CaseToken:n},e=t.fixStr(u.Captcha.Key(),"",!0),o=t.fixStr(u.Captcha.Answer(),"",!0),s=t.fixBool(u.Captcha.Refresh(),!1);e!=""&&(f.CKey=e,f.CAnswer=o,f.CRefresh=s);u.Captcha.Refresh(!1);i.services.Case.CaseSummary(f).success(function(n){u.parseSummary(n.Result);u.ob.Loading(!1)}).failure(function(n){i.app.checkHttpFailure(n).Redirected||(u.setTemplates(null),u.ob.Summary(null),u.ob.Loading(!1),t.pa.reportError("An error occurred while loading the case.",n.ErrorThrown,"CaseSummary.getSummary.failure","CaseSummary.js",n))})}catch(f){u.setTemplates(null);u.ob.Summary(null);u.ob.Loading(!1);console.error("CaseSummary.getSummary\r\n"+f)}};u.parseSummary=function(n){if(t.isNull(n)||t.isTrue(n.CaseNotFound)){u.ob.NotFound(!0);u.ob.Summary(null);return}if(t.isTrue(n.InvalidToken)){u.ob.InvalidToken(!0);u.ob.Summary(null);return}if(t.isTrue(n.AccessDenied)){u.ob.AccessDenied(!0);u.ob.Summary(null);return}if(u.ob.InvalidToken(!1),u.ob.NotFound(!1),u.ob.AccessDenied(!1),n.CaptchaKey){u.ob.Summary(null);u.Captcha.Key(n.CaptchaKey);u.Captcha.Url(n.Url);u.Captcha.Error(n.Error);u.Captcha.Answer(null);u.Captcha.Show(!0);return}u.Captcha.reset();u.setTemplates(n);var r=new i.viewModels.CaseSummary.Summary(n);u.ob.Summary(r)};u.setTemplates=function(n){t.isNull(n)};u.init=function(n){if(i.app.scrollToTop(),!t.isNull(n)){u.ob.HideToolbars(t.fixBool(n.HideToolbars,!1));u.ob.PALogo(t.fixBool(n.PALogo,!1));let i=t.fixStr(n.CaseToken,null,!0),r=t.fixStr(n.SRCT,null,!0);t.str.eq(u.static.CaseToken,i)||(u.static.CaseToken=i,u.static.SRCT=r,u.getSummary(i,r))}};u.hide=function(){u.ob.Visible(!1)};u.show=function(n){u.ob.Visible(!0);t.isTrue(i.app.ViewBag.getItem("Summary_FromResults"))?(u.static.FromResults=!0,i.app.ViewBag.setItem("Results_NoReload",!0)):u.static.FromResults=!1;t.isNull(n)||u.init(n)};u.init(r)};i.viewModels.CaseSummary.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.CaseSummary.prototype.constructor=i.viewModels.CaseSummary}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.Case=="undefined")throw"od.services.Case required";if(typeof window.od.viewModels=="undefined"||typeof window.od.viewModels.CaseSummary=="undefined")throw"od.viewModels.CaseSummary required";if(function(n,t,i){i.viewModels.CaseSummary.Summary=function(r){var u=this;t.isNull(r)||$.extend(u,{CaseNumber:r.CaseNumber,Court:r.Court,CaseType:r.CaseType,CaseStatus:r.CaseStatus,CaseStatusDate:r.CaseStatusDate,FileDate:r.FileDate,IsActive:r.IsActive,Style:r.Style,AppearByDate:r.AppearByDate,CommCourtFlag:r.CommCourtFlag});u.ob={Loading:n.observable(!1),Summary:n.observable(null),Parties:n.observableArray(null),Events:n.observableArray(null),Charges:n.observableArray(null),Bonds:n.observableArray(null),CrossRefs:n.observableArray(null),Related:n.observableArray(null),ACEligible:n.observable(!1),ACParties:n.observableArray(null)};u.comp={AnyPartyExp:n.computed(function(){var i=u.ob.Parties(),n;return t.arr.isEmpty(i)?!1:(n=!1,t.arr.each(i,function(i){if(!t.isNull(i)&&i.$expanded.peek()===!0)return n=!0,!0},!0),n)},u),AnyChargeExp:n.computed(function(){var i=u.ob.Charges(),n;return t.arr.isEmpty(i)?!1:(n=!1,t.arr.each(i,function(i){if(!t.isNull(i)&&i.$expanded.peek()===!0)return n=!0,!0},!0),n)},u),AnyBondExp:n.computed(function(){var i=u.ob.Bonds(),n;return t.arr.isEmpty(i)?!1:(n=!1,t.arr.each(i,function(i){if(!t.isNull(i)&&i.$expanded.peek()===!0)return n=!0,!0},!0),n)},u),AnyFincData:n.computed(function(){var i=u.ob.Parties(),n;return t.arr.isEmpty(i)?!1:(n=!1,t.arr.each(i,function(i){if(!t.isNull(i)&&i.$hasFinc===!0)return n=!0,!0},!0),n)},u)};u.parseEvents=function(n){if(t.isNull(n)||t.arr.isEmpty(n.Events)){u.ob.Events(null);return}var i=[];t.arr.each(n.Events,function(n){t.isNull(n)||(u.parseEventDocs(n),t.isNull(n.SEvent)?t.isNull(n.JEvent)?t.isNull(n.DispEvent)||u.parseDEvent(n.DispEvent):u.parseJEvent(n.JEvent):u.parseSEvent(n.SEvent),i.push(n))});t.arr.isEmpty(i)?u.ob.Events(null):u.ob.Events(i)};u.parseDEvent=function(n){t.isNull(n)||t.arr.isEmpty(n.Charges)||t.arr.each(n.Charges,function(n){t.isNull(n)||t.str.isNullOrWS(n.OffenseModification)||(n.OffenseDescription=t.fixStr(n.OffenseDescription,"",!0)+" ("+n.OffenseModification+")")})};u.parseSEvent=function(n){t.isNull(n)||(n.$hasSents=!t.arr.isEmpty(n.Sentences,!1),n.$hasSents&&t.arr.each(n.Sentences,function(n){t.isNull(n)||(n.$hasFees=!t.arr.isEmpty(n.Fees,!1),n.$hasCfns=!t.arr.isEmpty(n.Confinements,!1),n.$hasCmts=!t.arr.isEmpty(n.Comments,!1),n.$hasCnds=!t.arr.isEmpty(n.Conditions,!1),n.$hasAwards=!t.arr.isEmpty(n.Awards,!1))}))};u.parseJEvent=function(n){t.isNull(n)||(n.$hasJudgments=!t.arr.isEmpty(n.Judgments,!1),n.$hasJudgments&&t.arr.each(n.Judgments,function(n){t.isNull(n)||(n.$hasComments=!t.arr.isEmpty(n.Comments,!1),n.$hasAwards=!t.arr.isEmpty(n.Awards,!1))}))};u.parseEventDocs=function(i){if(!t.isNull(i)){if(i.$DocCount=0,i.$DocExp=n.observable(!1),t.arr.isEmpty(i.EventDocuments)){i.EventDocuments=null;return}var r=[];t.arr.each(i.EventDocuments,function(n){if(!t.isNull(n)&&!t.str.isNullOrWS(n.DownUrl)){n.DownUrl=t.url.combine(t.settings.AppUrlFull,n.DownUrl);var i="fa fa-file-";ext=t.fixStr(n.Ext,"",!0);i+=t.str.isNullOrWS(ext)?"o":t.str.eq(ext,"pdf",!0)?"pdf-o":t.str.eqAny(ext,["tif","tiff","jpg","jpeg","gif","png","bmp"],!0)?"image-o":t.str.eqAny(ext,["doc","docx","txt","rtf"],!0)?"text-o":t.str.eqAny(ext,["xls","xlsx"],!0)?"excel-o":"o";n.IconClass=i;r.push(n)}});t.arr.isEmpty(r)?i.EventDocuments=null:(i.EventDocuments=r,i.$DocCount=r.length)}};u.parseBonds=function(i){if(t.isNull(i)||t.arr.isEmpty(i.Bonds)){u.ob.Bonds(null);return}var r=[];t.arr.each(i.Bonds,function(i){t.isNull(i)||(i.$expanded=n.observable(!1),i.$hasNumber=!t.str.isNullOrWS(i.BondNumber),i.$hasAmount=!t.str.isNullOrWS(i.Amount),i.$hasStatusDate=!t.str.isNullOrWS(i.StatusDate),i.$hasDetails=i.$hasNumber||i.$hasAmount||i.$hasStatusDate,r.push(i))});t.arr.isEmpty(r)?u.ob.Bonds(null):u.ob.Bonds(r)};u.parseCRefs=function(n){if(t.isNull(n)||t.arr.isEmpty(n.CrossRefs)){u.ob.CrossRefs(null);return}var i=[];t.arr.each(n.CrossRefs,function(n){t.isNull(n)||i.push(n)});t.arr.isEmpty(i)?u.ob.CrossRefs(null):u.ob.CrossRefs(i)};u.parseRelated=function(n){if(t.isNull(n)||t.arr.isEmpty(n.Related)){u.ob.Related(null);return}var i=[];t.arr.each(n.Related,function(n){t.isNull(n)||i.push(n)});t.arr.isEmpty(i)?u.ob.Related(null):u.ob.Related(i)};u.parseCharges=function(i){if(t.isNull(i)||t.arr.isEmpty(i.Charges)){u.ob.Charges(null);return}var r=[];t.arr.each(i.Charges,function(i){t.isNull(i)||(i.$expanded=n.observable(!1),i.$hasCiteNum=!t.str.isNullOrWS(i.CitationNumber),i.$hasOffDate=!t.str.isNullOrWS(i.OffenseDate),i.$hasOffStat=!t.str.isNullOrWS(i.OffenseStatute),i.$hasOffDeg=!t.str.isNullOrWS(i.OffenseDegree),i.$hasOffMod=!t.str.isNullOrWS(i.OffenseModification),i.$hasOrgOff=!t.str.isNullOrWS(i.OrigOffenseDegree),i.$hasDetails=i.$hasCiteNum||i.$hasOffDate||i.$hasOffStat||i.$hasOffDeg||i.$hasOrgOff||i.$hasOffMod,r.push(i))});t.arr.isEmpty(r)?u.ob.Charges(null):u.ob.Charges(r)};u.parseParties=function(r){if(t.isNull(r)||t.arr.isEmpty(r.Parties)){u.ob.Parties(null);return}var f=[],e=i.enums.PartyCon;t.isTrue(r.IsAppellateCourt)?(t.arr.each(r.Parties,function(n){t.isNull(n)||t.fixInt(n.Connection,0)!==e.Appellant||f.push(n)}),t.arr.each(r.Parties,function(n){t.isNull(n)||t.fixInt(n.Connection,0)!==e.Appellee||f.push(n)}),t.arr.each(r.Parties,function(n){t.isNull(n)||t.eqAny(t.fixInt(n.Connection,0),[e.Attorney,e.Appellant,e.Appellee])||f.push(n)},!1,!1)):t.str.eqAny(r.CaseCategoryGroup,[i.enums.CategoryGroup.Civil,i.enums.CategoryGroup.Criminal],!0)&&(t.arr.each(r.Parties,function(n){t.isNull(n)||t.fixInt(n.Connection,0)!==e.Defendant||f.push(n)},!1,!1),t.arr.each(r.Parties,function(n){t.isNull(n)||t.eqAny(t.fixInt(n.Connection,0),[e.Attorney,e.Defendant])||f.push(n)},!1,!1));t.arr.isEmpty(f)?u.ob.Parties(null):(t.arr.each(f,function(i){i.FullName=u.getFullName(i);i.$expanded=n.observable(!1);i.$hasDOD=!t.str.isNullOrWS(i.DOD);i.$hasWarrants=t.fixInt(i.ActiveWarrants,0)>0;i.$hasAddress=!t.isNull(i.Address);i.$hasDesc=!t.str.isNullOrWS(i.Description);i.$hasOANs=!t.arr.isEmpty(i.OANs);i.$hasFinc=!t.isNull(i.FeeSummary)||!t.arr.isEmpty(i.Transactions);i.$isRemoved=!t.isNull(i.RemovedDate);i.$hasAttys=!1;t.arr.isEmpty(i.Attorneys)||(i.$hasAttys=!0,t.arr.each(i.Attorneys,function(n){n.$hasAddress=!t.isNull(n.Address);n.$hasPhone=!t.str.isNullOrWS(n.WorkPhone);n.$hasLabel=!t.str.isNullOrWS(n.Label)}));i.$hasDetails=i.$hasDOD||i.$hasAddress||i.$hasAttys||i.$hasDesc||i.$hasOANs||i.$hasDetails||i.$isRemoved}),u.ob.Parties(f))};u.parseAccessCodes=function(n){if(i.settings.AccessCodes.Enabled===!0&&!t.isNull(n)&&!t.arr.isEmpty(n.Parties)&&!t.isNull(n.AccessCodes)&&t.fixBool(n.AccessCodes.Eligible)!==!1&&t.fixBool(n.ShowACOptions)===!0){let r=[];t.arr.each(n.Parties,function(n){let i=n.AccessCodes;if(!t.isNull(i)&&t.fixBool(i.Eligible)===!0){let f=t.isNull(n.Address)?0:t.fixInt(n.Address.AddressID,0),e=t.fixInt(i.AddressID,0);f!=e&&console.log("Non-match AddressIDs (pt/ac)",f,e);f>0&&t.fixBool(n.Address.Masked)!==!0&&r.push({CaseKey:n.CaseKey,CasePartyKey:n.CasePartyKey,PartyKey:n.PartyKey,Name:n.NameFMLS||u.getFullName(n),AddressID:f,Address:u.getAddress(n),Masked:!1})}},!1,!1);t.arr.isEmpty(r)||(u.ob.ACEligible(!0),u.ob.ACParties(r))}};u.downloadDoc=function(n,i){return(t.stopEvent(i),t.isNull(n.$DocCount))?(t.downloadFile(n.DownUrl),!1):n.$DocCount>1?(n.$DocExp(!n.$DocExp()),!1):(t.downloadFile(n.EventDocuments[0].DownUrl),!1)};u.toggleParty=function(n,i){if(t.stopEvent(i),!t.isTrue(n.$hasDetails))return n.$expanded(!1),!1;var r=t.fixBool(n.$expanded.peek(),!1);return n.$expanded(!r),u.ob.Parties.valueHasMutated(),!1};u.toggleAllParties=function(n,i){t.stopEvent(i);var r=!u.comp.AnyPartyExp(),f=u.ob.Parties.peek();return t.arr.each(f,function(n){t.isTrue(n.$hasDetails)?n.$expanded(r):n.$expanded(!1)}),u.ob.Parties.valueHasMutated(),!1};u.toggleCharge=function(n,i){if(t.stopEvent(i),!t.isTrue(n.$hasDetails))return n.$expanded(!1),!1;var r=t.fixBool(n.$expanded.peek(),!1);return n.$expanded(!r),u.ob.Charges.valueHasMutated(),!1};u.toggleAllCharges=function(n,i){t.stopEvent(i);var r=!u.comp.AnyChargeExp(),f=u.ob.Charges.peek();return t.arr.each(f,function(n){t.isTrue(n.$hasDetails)?n.$expanded(r):n.$expanded(!1)}),u.ob.Charges.valueHasMutated(),!1};u.toggleBond=function(n,i){if(t.stopEvent(i),!t.isTrue(n.$hasDetails))return n.$expanded(!1),!1;var r=t.fixBool(n.$expanded.peek(),!1);return n.$expanded(!r),u.ob.Bonds.valueHasMutated(),!1};u.toggleAllBonds=function(n,i){t.stopEvent(i);var r=!u.comp.AnyBondExp(),f=u.ob.Bonds.peek();return t.arr.each(f,function(n){t.isTrue(n.$hasDetails)?n.$expanded(r):n.$expanded(!1)}),u.ob.Bonds.valueHasMutated(),!1};u.toggleDocuments=function(n,i){return t.stopEvent(i),!1};u.getFullName=function(n){if(t.isNull(n))return"";let i=t.fixStr(n.Name,""),r=t.fixStr(n.ExtendedName,"");return t.str.isNullOrWS(r)?i:i+", "+r};u.getAddress=function(n){var r,i,u;return t.isNull(n)||t.isNull(n.Address)?"":(r="",i=0,t.str.isNullOrWS(n.Address.Line1)||(r+=n.Address.Line1,i=r.length),t.str.isNullOrWS(n.Address.Line2)||(r+=(i>0?"<br />":"")+n.Address.Line2,i=r.length),t.str.isNullOrWS(n.Address.Line3)||(r+=(i>0?"<br />":"")+n.Address.Line3,i=r.length),t.str.isNullOrWS(n.Address.Line4)||(r+=(i>0?"<br />":"")+n.Address.Line4,i=r.length),u="",i=0,t.str.isNullOrWS(n.Address.City)||(u+=n.Address.City,i=u.length),t.str.isNullOrWS(n.Address.State)||(u+=(i>0?", ":"")+n.Address.State,i=u.length),t.str.isNullOrWS(n.Address.Zip)||(u+=(i>0?" ":"")+n.Address.Zip+(t.str.isNullOrWS(n.Address.Zip4)?"":"-"+n.Address.Zip4)),r.length>0?r+(u.length>0?"<br />"+u:""):u.length>0?u:"")};u.getEventTypeTmpl=function(n){return t.isNull(n)?null:t.isNull(n.CaseEvent)?t.isNull(n.HearingEvent)?t.isNull(n.SEvent)?t.isNull(n.JEvent)?t.isNull(n.DispEvent)?t.isNull(n.VEvent)?t.isNull(n.AEvent)?null:"tpAEvent":"tpVEvent":"tpDispEvt":"tpJEvent":"tpSentEvt":"tpHearEvt":"tpCaseEvt"};u.reset=function(){u.ob.Parties(null);u.ob.Events(null);u.ob.Charges(null);u.ob.Bonds(null);u.ob.CrossRefs(null);u.ob.Related(null);u.ob.ACEligible(!1);u.ob.ACParties(null);u.ob.Summary(null)};u.init=function(n){if(t.isNull(n)){u.reset();return}i.app.scrollToTop();u.parseParties(n);u.parseEvents(n);u.parseBonds(n);u.parseCharges(n);u.parseCRefs(n);u.parseRelated(n);u.parseAccessCodes(n);u.ob.Summary(n)};t.isNull(r)||u.init(r)}}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.Case=="undefined")throw"od.services.Case required";if(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.ACRequest=function(r){i.viewModels.ModelBase.call(this,"ACRequest","Request Access Code","~/ACRequest");var u=this;u.static={};u.ob={Visible:n.observable(!1),Loading:n.observable(!1),Step:n.observable(1),CaseNumber:n.observable(null),Parties:n.observableArray(null),Party:n.observable(null),AddrConfirm:n.observable(null),UserID:n.observable(null)};u.form={CaseToken:n.observable(null),CasePartyKey:n.observable(null),AddressID:n.observable(null)};u.comp={DisableControls:n.pureComputed(function(){var n=u.ob.Loading();return n===!0},u),S2Disabled:n.pureComputed(function(){let n=u.ob.Loading(),i=u.form.CasePartyKey(),r=u.comp.LoggedIn();return n===!0||r!==!0||t.str.isNullOrWS(i)},u),S3Disabled:n.pureComputed(function(){let n=u.ob.Loading(),i=u.ob.AddrConfirm(),r=u.comp.LoggedIn();return n===!0||r!==!0||t.isNull(i)},u),S1NextTT:n.pureComputed(function(){let i=u.form.CasePartyKey(),r=u.comp.LoggedIn(),n="to request an Access Code by mail";return r!==!0?"Sign in "+n:t.str.isNullOrWS(i)?"Select your name "+n:"Continue to the next step"},u),S2NextTT:n.pureComputed(function(){let n=u.ob.AddrConfirm();return t.isNull(n)?"Select Yes or No to continue":"Continue to the next step"},u),S2Address:n.pureComputed(function(){let n=null,i=u.ob.Party();return t.isNull(i)||(n=i.Address),t.str.isNullOrWS(n)?"Address unknown or error":n},u),S2Confirmed:n.pureComputed(function(){let n=u.ob.AddrConfirm();return n==="yes"},u),PartyName:n.pureComputed(function(){let n=u.ob.Party();return t.isNull(n)?"the selected party":n.Name},u),LoggedIn:n.pureComputed(function(){let n=u.ob.UserID();return!t.isNull(n)},u)};u.subs={CasePartyKey:u.form.CasePartyKey.subscribe(function(n){let i=t.str.isNullOrWS(n)?null:t.arr.firstMatch(u.ob.Parties()||[],"CasePartyKey",n);u.ob.Party(i)},u),AddrConfirm:u.ob.AddrConfirm.subscribe(function(n){let i=n==="yes"?u.ob.Party():null;u.form.AddressID(t.isNull(i)?null:i.AddressID)},u),LoggedIn:i.app.user.LoggedIn.subscribe(function(n){u.ob.UserID(t.fixBool(n)===!0?i.app.user.UserID.peek():null)},u)};u.backClick=function(n,i){return t.stopEvent(i),u.goBack(),!1};u.goBack=function(){let n=u.form.CaseToken();t.str.isNullOrWS(n)?window.history.back():i.app.setView("CaseSummary",{CaseToken:n},!0)};u.s1NextClick=function(n,i){return t.stopEvent(i),u.comp.S2Disabled()===!1&&u.ob.Step(2),!1};u.s2NextClick=function(n,i){return t.stopEvent(i),u.comp.S3Disabled()===!1&&u.ob.Step(3),!1};u.submitClick=function(n,i){return(t.stopEvent(i),t.isTrue(u.ob.Loading.peek()))?!1:(t.pa.notify.clear(),u.submit(),!1)};u.signInClick=function(n,r){t.stopEvent(r);window.location=i.links.Login+u.getReturnUrlParam()};u.signUpClick=function(n,r){t.stopEvent(r);window.location=i.links.Register+u.getReturnUrlParam()};u.getReturnUrlParam=function(){let n=u.form.CaseToken();return t.str.isNullOrWS(n)?"":"?ReturnUrl="+encodeURIComponent(t.pa.ModuleUrlFull+i.app.getViewHash("CaseSummary",{CaseToken:n}))};u.submit=function(){try{u.ob.Loading(!0);let n={CaseToken:u.form.CaseToken(),CasePartyID:t.fixInt(u.form.CasePartyKey(),0),AddressID:t.fixInt(u.form.AddressID(),0)};i.services.AccessCode.RequestCode(n).success(function(n){u.parseResult(n)}).failure(function(n){u.parseResult(n,!0)})}catch(n){u.parseResult({ErrorThrown:n},!0)}};u.parseResult=function(n,i){let r=i||t.isNull(n)||t.isNull(n.Result)||!t.fixBool(n.Result.Success);r?(t.pa.reportError(null,(n||{}).ErrorThrown,"submit()",u.ViewName,n),u.ob.Step(-1)):u.ob.Step(4);u.ob.Loading(!1)};u.init=function(n){t.isNull(n)||(t.arr.isEmpty(n.Parties)||u.ob.Parties(n.Parties),u.form.CaseToken(t.fixStr(n.CaseToken,null,!0)),u.ob.CaseNumber(t.fixStr(n.CaseNumber,null,!0)))};u.reset=function(){u.form.CaseToken(null);u.form.CasePartyKey(null);u.form.AddressID(null);u.ob.AddrConfirm(null);u.ob.Party(null);u.ob.Parties(null);u.ob.CaseNumber(null);u.ob.Step(1)};u.hide=function(){u.ob.Visible(!1);u.reset()};u.show=function(n){u.init(n);u.ob.UserID(i.app.user.UserID.peek());u.ob.Visible(!0);(t.isNull(u.ob.Parties())||t.isNull(u.form.CaseToken()))&&(console.log("invalid request"),i.app.setView("Search",{NewSearch:!0}))};u.init(r)};i.viewModels.ACRequest.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.ACRequest.prototype.constructor=i.viewModels.ACRequest}(window.ko,window.ct,window.od),typeof ko=="undefined")throw"Knockout required";if(typeof ct=="undefined")throw"ct required";if(typeof od=="undefined")throw"od required";if(typeof window.od.services=="undefined")throw"od.services required";if(typeof window.od.services.Case=="undefined")throw"od.services.Case required";(function(n,t,i){t.isNull(i.viewModels)&&(i.viewModels={});i.viewModels.My=function(r){i.viewModels.ModelBase.call(this,"My","My Cases","~/My");var u=this;u.MsgBox=new i.viewModels.MsgBox;let f={ShowDet:"MyCases_ShowDetails",SortBy:"MyCases_SortBy",SortDir:"MyCases_SortDir",TableMode:"MyCases_TableMode"};u.sorts=Object.assign({},i.CaseSorts);u.static={DefSortBy:t.storage.sessionGet(f.SortBy,"FileDate"),DefSortDir:t.storage.sessionGet(f.SortDir,"DESC"),CodeLength:i.settings.AccessCodes.CodeLength};u.ob={Visible:n.observable(!1),Loading:n.observable(!1),ShowSort:n.observable(!1),ShowACConfirm:n.observable(!1),SummaryLoaded:n.observable(!1),LoggedIn:n.observable(!1),IsAttorney:n.observable(!1),Cases:n.observableArray(null),Failed:n.observable(!1)};u.form={Code:n.observable(null),SortBy:n.observable(u.static.DefSortBy),SortByChoice:n.observable(u.static.DefSortBy),SortDir:n.observable(u.static.DefSortDir),SortDirChoice:n.observable(u.static.DefSortDir)};u.comp={DisableControls:n.pureComputed(function(){let n=u.ob.Loading(),t=u.ob.Failed(),i=u.ob.Visible(),r=u.ob.ShowSort(),f=u.ob.ShowACConfirm();return n||t||!i||r||f},u),CurSort:n.pureComputed(function(){let i=u.form.SortBy(),r=u.form.SortDir(),n=u.sorts.getLabel(i);return t.str.isNullOrWS(n)?"":t.str.eq(r,"DESC",!0)?n+", Descending":n+", Ascending"},u),HasCode:n.pureComputed(function(){let n=u.form.Code();return!t.str.isNullOrWS(n)},u),HasCases:n.pureComputed(function(){let n=u.ob.Cases();return!t.arr.isEmpty(n)},u)};u.subs={SortBy:u.form.SortBy.subscribe(function(n){t.storage.sessionSet(f.SortBy,n);u.form.SortByChoice(n)},u),SortDir:u.form.SortDir.subscribe(function(n){t.storage.sessionSet(f.SortDir,n);u.form.SortDirChoice(n)},u)};u.sortHidden=function(n){let t=n.ob.ShowSort();t===!0&&n.ob.ShowSort(!1)};u.acConfirmHidden=function(n){let t=n.ob.ShowACConfirm();t===!0&&n.ob.ShowACConfirm(!1)};u.backClick=function(n,i){return t.stopEvent(i),u.comp.DisableControls()!==!0&&window.history.back(),!1};u.sortClick=function(n,i){return u.comp.DisableControls()===!0?(t.stopEvent(i),!1):(u.ob.ShowSort(!0),!0)};u.sortApplyClick=function(n,i){t.stopEvent(i);u.ob.ShowSort(!1);var r=u.form.SortBy.peek(),f=u.form.SortDir.peek(),e=u.form.SortByChoice.peek(),o=u.form.SortDirChoice.peek();return t.str.eq(r,e,!0)&&t.str.eq(f,o,!0)||(u.form.SortBy(t.fixStr(e,r)),u.form.SortDir(t.fixStr(o,f)),u.getSummary()),!1};u.addCodeClick=function(n,i){if(u.comp.DisableControls()!==!0){t.pa.notify.clear();let n=t.fixStr(u.form.Code.peek(),"").trim(),i=u.static.CodeLength;if(t.str.isNullOrWS(n)||n.length!=i)u.MsgBox.warning("Please enter a "+i+" character access code.");else return u.ob.ShowACConfirm(!0),!0}return t.stopEvent(i),!1};u.confirmCodeClick=function(n,i){t.stopEvent(i);u.ob.ShowACConfirm(!1);u.addCode()};u.addCode=function(){try{u.ob.Loading(!0);let n={Code:t.fixStr(u.form.Code.peek(),"")};i.services.AccessCode.AddCode(n).success(function(n){u.parseAddResult(n)}).failure(function(n){u.parseAddResult(n,!0)})}catch(n){u.parseAddResult({ErrorThrown:n},!0)}};u.parseAddResult=function(n,r){let f=!1;if(t.isNull(n)?(f=!0,n={}):f=r||n.IsError||t.isNull(n.Result)||n.Result.IsError===!0,f)u.MsgBox.error(i.app.lang.genError),t.pa.reportError(null,n.ErrorThrown,null,u.ViewName,null);else{let t=n.Result;t.IsSuccess===!0?(u.form.Code(null),u.getSummary(),u.MsgBox.success(t.UserMessage)):u.MsgBox.warning(t.UserMessage)}u.ob.Loading(!1)};u.getSummary=function(){try{u.ob.Loading(!0);let n={Sort:u.form.SortBy.peek()+" "+u.form.SortDir.peek()};i.services.MyCases.Summary(n).success(function(n){u.parseSummary(n)}).failure(function(n){u.parseSummary(n,!0)})}catch(n){u.parseSummary({ErrorThrown:n},!0)}};u.parseSummary=function(n,r){let f=!1;if(t.isNull(n)?(f=!0,n={}):f=r||n.IsError||t.isNull(n.Result),f)u.ob.Failed(!0),u.MsgBox.error(i.app.lang.genError),t.pa.reportError(null,n.ErrorThrown,null,u.ViewName,null);else{let i=n.Result;u.ob.LoggedIn(t.fixBool(i.IsLoggedIn));u.ob.IsAttorney(t.fixBool(i.IsAttorney));u.ob.Cases(i.Cases);u.ob.SummaryLoaded(!0)}u.ob.Loading(!1)};u.searchClick=function(n,i){return t.stopEvent(i),window.location=t.pa.ModuleUrlFull,!1};u.caseClick=function(n,i){return(t.stopEvent(i),!t.isNum(n.CaseID)||n.CaseID<1)?!1:(window.location=n.CaseToken,!1)};u.init=function(){};u.reset=function(){u.form.Code(null);u.ob.ShowSort(!1);u.ob.ShowACConfirm(!1);u.ob.LoggedIn(!1);u.ob.IsAttorney(!1);u.ob.Failed(!1)};u.hide=function(){u.ob.Visible(!1);u.reset()};u.show=function(n){u.init(n);u.reset();u.getSummary();i.app.scrollToTop();u.ob.Visible(!0)};u.init(r)};i.viewModels.My.prototype=Object.create(i.viewModels.ModelBase.prototype);i.viewModels.My.prototype.constructor=i.viewModels.My})(window.ko,window.ct,window.od)